bt: fix OS abstraction layer for correct critical section API usage
@@ -254,13 +254,21 @@ bool IRAM_ATTR btdm_queue_generic_deregister(btdm_queue_item_t *queue)
static void IRAM_ATTR interrupt_disable(void)
{
+ if (xPortInIsrContext()) {
+ portENTER_CRITICAL_ISR(&global_int_mux);
+ } else {
portENTER_CRITICAL(&global_int_mux);
}
+}
static void IRAM_ATTR interrupt_restore(void)
{
+ if (xPortInIsrContext()) {
+ portEXIT_CRITICAL_ISR(&global_int_mux);
+ } else {
portEXIT_CRITICAL(&global_int_mux);
}
+}
static void IRAM_ATTR task_yield_from_isr(void)
{
