Skip to content

Commit 308a236

Browse files
committed
OS timer uses LPTICKER by default, then USTICKER
1 parent 475621c commit 308a236

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

platform/source/mbed_os_timer.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "us_ticker_api.h"
2323
#include "lp_ticker_api.h"
2424
#include "mbed_critical.h"
25-
#include "mbed_assert.h"
25+
#include "mbed_error.h"
2626
#include <new>
2727

2828
/* This provides the marshalling point for a system global SysTimer, which
@@ -47,13 +47,12 @@ OsTimer *init_os_timer()
4747
// Locking not required as it will be first called during
4848
// OS init, or else we're a non-RTOS single-threaded setup.
4949
if (!os_timer) {
50-
#if MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER && DEVICE_USTICKER
51-
os_timer = new (os_timer_data) OsTimer(get_us_ticker_data());
52-
#elif !MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER && DEVICE_LPTICKER
50+
#if DEVICE_LPTICKER && !MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER
5351
os_timer = new (os_timer_data) OsTimer(get_lp_ticker_data());
52+
#elif DEVICE_USTICKER
53+
os_timer = new (os_timer_data) OsTimer(get_us_ticker_data());
5454
#else
55-
MBED_ASSERT("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER" && false);
56-
return NULL;
55+
error("OS timer not available - check MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER");
5756
#endif
5857
//os_timer->setup_irq();
5958
}

0 commit comments

Comments
 (0)