From 847b2f965e28c47e33de9d232c3b8f681bc73f1b Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Fri, 19 Aug 2016 22:51:54 -0500 Subject: [PATCH] Updated mbed implementation to use sleep Also corrected small bug in alignment calculation for class buffers --- equeue_mbed.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/equeue_mbed.cpp b/equeue_mbed.cpp index cf3004d..122910a 100644 --- a/equeue_mbed.cpp +++ b/equeue_mbed.cpp @@ -15,9 +15,11 @@ // Ticker operations static bool equeue_tick_inited = false; -static unsigned equeue_timer[(sizeof(Timer)+1) / sizeof(unsigned)]; -static unsigned equeue_ticker[(sizeof(Ticker)+1) / sizeof(unsigned)]; static unsigned equeue_minutes = 0; +static unsigned equeue_timer[ + (sizeof(Timer)+sizeof(unsigned)-1)/sizeof(unsigned)]; +static unsigned equeue_ticker[ + (sizeof(Ticker)+sizeof(unsigned)-1)/sizeof(unsigned)]; static void equeue_tick_update() { reinterpret_cast(equeue_timer)->reset(); @@ -112,7 +114,7 @@ bool equeue_sema_wait(equeue_sema_t *s, int ms) { core_util_critical_section_enter(); while (!*s) { - __WFI(); + sleep(); core_util_critical_section_exit(); core_util_critical_section_enter(); }