8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 273fb84 commit 5204dabCopy full SHA for 5204dab
cores/rp2040/CoreMutex.cpp
@@ -30,10 +30,15 @@ CoreMutex::CoreMutex(mutex_t *mutex, uint8_t option) {
30
_option = option;
31
if (__isFreeRTOS) {
32
auto m = __get_freertos_mutex_for_ptr(mutex);
33
- if (__freertos_check_if_in_isr() && !__freertos_mutex_take_from_isr(m)) {
34
- return;
+ if (__freertos_check_if_in_isr()) {
+ if (!__freertos_mutex_take_from_isr(m)) {
35
+ return;
36
+ }
37
+ // At this point we have the mutex in ISR
38
+ } else {
39
+ // Grab the mutex normally, possibly waking other tasks to get it
40
+ __freertos_mutex_take(m);
41
}
- __freertos_mutex_take(m);
42
} else {
43
uint32_t owner;
44
if (!mutex_try_enter(_mutex, &owner)) {
0 commit comments