Update stats to fetch Mbed OS version info

pull/7436/head
Deepika 2018-07-06 11:29:56 -05:00
parent c5ba97fbe0
commit b05d105493
3 changed files with 4 additions and 1 deletions

View File

@ -32,6 +32,7 @@ void test_sys_info()
mbed_stats_sys_t stats;
mbed_stats_sys_get(&stats);
TEST_ASSERT_NOT_EQUAL(0, stats.os_version);
#if defined(__CORTEX_M)
TEST_ASSERT_NOT_EQUAL(0, stats.cpu_id);
#endif

View File

@ -1,6 +1,7 @@
#include "mbed_assert.h"
#include "mbed_stats.h"
#include "mbed_power_mgmt.h"
#include "mbed_version.h"
#include <string.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));
#if defined(MBED_SYS_STATS_ENABLED)
stats->os_version = MBED_VERSION;
#if defined(__CORTEX_M)
stats->cpu_id = SCB->CPUID;
#endif

View File

@ -6,7 +6,7 @@
* @{
*/
/* 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");
* you may not use this file except in compliance with the License.