Added additional read to care of lazyily initialized timer

pull/6857/head
Deepika 2018-05-17 10:25:31 -05:00
parent 7900863c4d
commit 25e2b8838a
1 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,8 @@ void get_cpu_usage()
void test_cpu_info(void)
{
mbed_stats_cpu_t stats;
// Additional read to make sure timer is initialized
mbed_stats_cpu_get(&stats);
Thread::wait(1);
mbed_stats_cpu_get(&stats);
TEST_ASSERT_NOT_EQUAL(0, stats.uptime);