Merge pull request #587 from ourairquality/newlib-locks-nmi
newlib: skip locking when within the NMI Irq.
This commit is contained in:
commit
07772c643d
1 changed files with 7 additions and 0 deletions
|
@ -303,6 +303,10 @@ void _lock_acquire(_lock_t *lock) {
|
||||||
|
|
||||||
void _lock_acquire_recursive(_lock_t *lock) {
|
void _lock_acquire_recursive(_lock_t *lock) {
|
||||||
if (locks_initialized) {
|
if (locks_initialized) {
|
||||||
|
if (sdk_NMIIrqIsOn) {
|
||||||
|
uart_putc(0, ':');
|
||||||
|
return;
|
||||||
|
}
|
||||||
xSemaphoreTakeRecursive((QueueHandle_t)*lock, portMAX_DELAY);
|
xSemaphoreTakeRecursive((QueueHandle_t)*lock, portMAX_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,6 +325,9 @@ void _lock_release(_lock_t *lock) {
|
||||||
|
|
||||||
void _lock_release_recursive(_lock_t *lock) {
|
void _lock_release_recursive(_lock_t *lock) {
|
||||||
if (locks_initialized) {
|
if (locks_initialized) {
|
||||||
|
if (sdk_NMIIrqIsOn) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
xSemaphoreGiveRecursive((QueueHandle_t)*lock);
|
xSemaphoreGiveRecursive((QueueHandle_t)*lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue