Description
In the following controller code:
mynewt-nimble/nimble/controller/src/ble_ll_rfmgmt.c
Lines 285 to 300 in 7b14eab
ble_ll_event_add
is called while inside a critical section. This calls:
mynewt-nimble/nimble/controller/src/ble_ll.c
Lines 1426 to 1430 in 7b14eab
In case of FreeRTOS,
mynewt-nimble/porting/npl/freertos/include/nimble/nimble_npl_os.h
Lines 100 to 104 in 7b14eab
mynewt-nimble/porting/npl/freertos/src/npl_os_freertos.c
Lines 60 to 80 in 7b14eab
As you can see above, xQueueSendToBack
is called with portMAX_DELAY
. I guess at the very least, we should add a zero delay if we're within a critical section. Also, see https://forums.freertos.org/t/critical-sections-freertos-api-calls/17352.