Skip to content

Commit b05d105

Browse files
author
Deepika
committed
Update stats to fetch Mbed OS version info
1 parent c5ba97f commit b05d105

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

TESTS/mbed_platform/stats_sys/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ void test_sys_info()
3232
mbed_stats_sys_t stats;
3333
mbed_stats_sys_get(&stats);
3434

35+
TEST_ASSERT_NOT_EQUAL(0, stats.os_version);
3536
#if defined(__CORTEX_M)
3637
TEST_ASSERT_NOT_EQUAL(0, stats.cpu_id);
3738
#endif

platform/mbed_stats.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "mbed_assert.h"
22
#include "mbed_stats.h"
33
#include "mbed_power_mgmt.h"
4+
#include "mbed_version.h"
45
#include <string.h>
56
#include <stdlib.h>
67

@@ -123,6 +124,7 @@ void mbed_stats_sys_get(mbed_stats_sys_t *stats)
123124
memset(stats, 0, sizeof(mbed_stats_sys_t));
124125

125126
#if defined(MBED_SYS_STATS_ENABLED)
127+
stats->os_version = MBED_VERSION;
126128
#if defined(__CORTEX_M)
127129
stats->cpu_id = SCB->CPUID;
128130
#endif

platform/mbed_stats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @{
77
*/
88
/* mbed Microcontroller Library
9-
* Copyright (c) 2016-2016 ARM Limited
9+
* Copyright (c) 2016-2018 ARM Limited
1010
*
1111
* Licensed under the Apache License, Version 2.0 (the "License");
1212
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)