File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
TESTS/mbed_platform/stats_sys Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,14 @@ void test_sys_info()
32
32
mbed_stats_sys_t stats;
33
33
mbed_stats_sys_get (&stats);
34
34
35
+ #if defined(MBED_VERSION)
36
+ TEST_ASSERT_NOT_EQUAL (0 , stats.os_version );
37
+ #endif
38
+
39
+ #if defined(__CORTEX_M)
35
40
TEST_ASSERT_NOT_EQUAL (0 , stats.cpu_id );
41
+ #endif
42
+
36
43
#if defined(__IAR_SYSTEMS_ICC__)
37
44
TEST_ASSERT_EQUAL (IAR, stats.compiler_id );
38
45
#elif defined(__CC_ARM)
Original file line number Diff line number Diff line change @@ -106,9 +106,12 @@ void mbed_stats_sys_get(mbed_stats_sys_t *stats)
106
106
memset (stats , 0 , sizeof (mbed_stats_sys_t ));
107
107
108
108
#if defined(MBED_SYS_STATS_ENABLED )
109
-
109
+ #if defined(MBED_VERSION )
110
+ stats -> os_version = MBED_VERSION ;
111
+ #endif
112
+ #if defined(__CORTEX_M )
110
113
stats -> cpu_id = SCB -> CPUID ;
111
-
114
+ #endif
112
115
#if defined(__IAR_SYSTEMS_ICC__ )
113
116
stats -> compiler_id = IAR ;
114
117
stats -> compiler_version = __VER__ ;
Original file line number Diff line number Diff line change @@ -118,7 +118,8 @@ typedef enum {
118
118
* struct mbed_stats_sys_t definition
119
119
*/
120
120
typedef struct {
121
- uint32_t cpu_id ; /**< CPUID Register data */
121
+ uint32_t os_version ; /**< Mbed OS Version (Release only) */
122
+ uint32_t cpu_id ; /**< CPUID Register data (Cortex-M only supported) */
122
123
mbed_compiler_id_t compiler_id ; /**< Compiler ID \ref mbed_compiler_id_t */
123
124
uint32_t compiler_version ; /**< Compiler version */
124
125
} mbed_stats_sys_t ;
You can’t perform that action at this time.
0 commit comments