Skip to content

Commit

Permalink
mbed_rtx_idle: fix ticker macro checks
Browse files Browse the repository at this point in the history
If a ticker is unavailable, its macro is undefined and cannot
be checked with MBED_STATIC_ASSERT.
  • Loading branch information
LDong-Arm committed May 16, 2019
1 parent 9fc54c9 commit 427c7db
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions rtos/TARGET_CORTEX/mbed_rtx_idle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ extern "C" {

#ifdef MBED_TICKLESS

MBED_STATIC_ASSERT(!MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER || DEVICE_USTICKER,
"Microsecond ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is true");
MBED_STATIC_ASSERT(MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER || DEVICE_LPTICKER,
"Low power ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is false");
#if MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER && !DEVICE_USTICKER
#error Microsecond ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is true
#endif

#if !MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER && !DEVICE_LPTICKER
#error Low power ticker required when MBED_CONF_TARGET_TICKLESS_FROM_US_TICKER is false
#endif

#include "rtos/TARGET_CORTEX/SysTimer.h"

Expand Down Expand Up @@ -137,7 +140,7 @@ extern "C" {
}


#else
#else // MBED_TICKLESS

static void default_idle_hook(void)
{
Expand All @@ -149,7 +152,7 @@ extern "C" {
core_util_critical_section_exit();
}

#endif // (defined(MBED_TICKLESS) && DEVICE_LPTICKER)
#endif // MBED_TICKLESS

static void (*idle_hook_fptr)(void) = &default_idle_hook;

Expand Down

0 comments on commit 427c7db

Please sign in to comment.