Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit f8dd3b0

Browse files
committed
Fixed compilation error on Cortex A platforms
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.
1 parent 90f2b7d commit f8dd3b0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

equeue_mbed.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ int equeue_mutex_create(equeue_mutex_t *m) { return 0; }
5252
void equeue_mutex_destroy(equeue_mutex_t *m) { }
5353

5454
void equeue_mutex_lock(equeue_mutex_t *m) {
55-
*m = __get_PRIMASK();
56-
__disable_irq();
55+
core_util_critical_section_enter();
5756
}
5857

5958
void equeue_mutex_unlock(equeue_mutex_t *m) {
60-
__set_PRIMASK(*m);
59+
core_util_critical_section_exit();
6160
}
6261

6362

0 commit comments

Comments
 (0)