Skip to content

Commit

Permalink
Updated mbed implementation to use sleep
Browse files Browse the repository at this point in the history
Also corrected small bug in alignment calculation for class buffers
  • Loading branch information
geky committed Aug 20, 2016
1 parent 3e935f4 commit 847b2f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions equeue_mbed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Timer*>(equeue_timer)->reset();
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 847b2f9

Please sign in to comment.