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:
Earle F. Philhower, III
2023-05-23 10:12:52 -07:00
committed by GitHub
parent cac9eb0cd7
commit 652f9f9eda
5 changed files with 10 additions and 7 deletions
+4 -2
View File
@@ -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);
}