Skip to content

Commit

Permalink
Fixed compilation error on Cortex A platforms
Browse files Browse the repository at this point in the history
Before, __get_PRIMASK/__set_PRIMASK were used directly to manipulate
the state of interrupts. These are only available on Cortex M
platforms.

Adopted core_util_critical_section_enter/exit from mbed critical.h,
which provides this behaviour in a cross-platform manner.
  • Loading branch information
geky committed Aug 5, 2016
1 parent 90f2b7d commit f8dd3b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions equeue_mbed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ int equeue_mutex_create(equeue_mutex_t *m) { return 0; }
void equeue_mutex_destroy(equeue_mutex_t *m) { }

void equeue_mutex_lock(equeue_mutex_t *m) {
*m = __get_PRIMASK();
__disable_irq();
core_util_critical_section_enter();
}

void equeue_mutex_unlock(equeue_mutex_t *m) {
__set_PRIMASK(*m);
core_util_critical_section_exit();
}


Expand Down

0 comments on commit f8dd3b0

Please sign in to comment.