Skip to content

Commit

Permalink
Update stats to fetch Mbed OS version info
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepika committed Jul 13, 2018
1 parent c5ba97f commit b05d105
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions TESTS/mbed_platform/stats_sys/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions platform/mbed_stats.c
Original file line number Diff line number Diff line change
@@ -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>

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion platform/mbed_stats.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b05d105

Please sign in to comment.