Fix FreeRTOS CoreMutex shim to handle ISRs (#1442)
* Fix FreeRTOS CoreMutex shim to handle ISRs Automatically check, when in FreeRTOS, if we're in an ISR and if so call the correct mutex grab. Thanks to @caveman99 for finding and proposing a solution! Fixes #1441 * Fix the CoreMutex destructor, too
This commit was merged in pull request #1442.
This commit is contained in:
@@ -85,6 +85,10 @@ extern "C" {
|
||||
void __freertos_recursive_mutex_give(SemaphoreHandle_t mtx) {
|
||||
xSemaphoreGiveRecursive(mtx);
|
||||
}
|
||||
|
||||
bool __freertos_check_if_in_isr() {
|
||||
return portCHECK_IF_IN_ISR();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -488,5 +492,3 @@ void __USBStart() {
|
||||
xTaskCreate(__usb, "USB", 256, 0, configMAX_PRIORITIES - 2, &__usbTask);
|
||||
vTaskCoreAffinitySet(__usbTask, 1 << 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user