mirror of https://github.com/ARMmbed/mbed-os.git
Update stats to fetch Mbed OS version info
parent
2e0139ebc9
commit
62990b487d
|
@ -32,6 +32,7 @@ void test_sys_info()
|
||||||
mbed_stats_sys_t stats;
|
mbed_stats_sys_t stats;
|
||||||
mbed_stats_sys_get(&stats);
|
mbed_stats_sys_get(&stats);
|
||||||
|
|
||||||
|
TEST_ASSERT_NOT_EQUAL(0, stats.os_version);
|
||||||
#if defined(__CORTEX_M)
|
#if defined(__CORTEX_M)
|
||||||
TEST_ASSERT_NOT_EQUAL(0, stats.cpu_id);
|
TEST_ASSERT_NOT_EQUAL(0, stats.cpu_id);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "mbed_assert.h"
|
#include "mbed_assert.h"
|
||||||
#include "mbed_stats.h"
|
#include "mbed_stats.h"
|
||||||
#include "mbed_power_mgmt.h"
|
#include "mbed_power_mgmt.h"
|
||||||
|
#include "mbed_version.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -123,6 +124,7 @@ void mbed_stats_sys_get(mbed_stats_sys_t *stats)
|
||||||
memset(stats, 0, sizeof(mbed_stats_sys_t));
|
memset(stats, 0, sizeof(mbed_stats_sys_t));
|
||||||
|
|
||||||
#if defined(MBED_SYS_STATS_ENABLED)
|
#if defined(MBED_SYS_STATS_ENABLED)
|
||||||
|
stats->os_version = MBED_VERSION;
|
||||||
#if defined(__CORTEX_M)
|
#if defined(__CORTEX_M)
|
||||||
stats->cpu_id = SCB->CPUID;
|
stats->cpu_id = SCB->CPUID;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2016-2016 ARM Limited
|
* Copyright (c) 2016-2018 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
Loading…
Reference in New Issue