component/bt : fix bug of task schedule delayed.

1. BLE RX test mode require quick task reaction, so allow higher priority task schedule from ISR.
2. Maybe other scenario also require this.
pull/293/merge
Tian Hao 2017-06-07 14:58:17 +08:00
rodzic 99d5959d8a
commit bd309731da
2 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -75,6 +75,7 @@ struct osi_funcs_t {
void (*_interrupt_disable)(void); void (*_interrupt_disable)(void);
void (*_interrupt_restore)(void); void (*_interrupt_restore)(void);
void (*_task_yield)(void); void (*_task_yield)(void);
void (*_task_yield_from_isr)(void);
void *(*_semphr_create)(uint32_t max, uint32_t init); void *(*_semphr_create)(uint32_t max, uint32_t init);
int32_t (*_semphr_give_from_isr)(void *semphr, void *hptw); int32_t (*_semphr_give_from_isr)(void *semphr, void *hptw);
int32_t (*_semphr_take)(void *semphr, uint32_t block_time_ms); int32_t (*_semphr_take)(void *semphr, uint32_t block_time_ms);
@ -104,6 +105,11 @@ static void IRAM_ATTR interrupt_restore(void)
portEXIT_CRITICAL(&global_int_mux); portEXIT_CRITICAL(&global_int_mux);
} }
static void IRAM_ATTR task_yield_from_isr(void)
{
portYIELD_FROM_ISR();
}
static void *IRAM_ATTR semphr_create_wrapper(uint32_t max, uint32_t init) static void *IRAM_ATTR semphr_create_wrapper(uint32_t max, uint32_t init)
{ {
return (void *)xSemaphoreCreateCounting(max, init); return (void *)xSemaphoreCreateCounting(max, init);
@ -155,6 +161,7 @@ static struct osi_funcs_t osi_funcs = {
._interrupt_disable = interrupt_disable, ._interrupt_disable = interrupt_disable,
._interrupt_restore = interrupt_restore, ._interrupt_restore = interrupt_restore,
._task_yield = vPortYield, ._task_yield = vPortYield,
._task_yield_from_isr = task_yield_from_isr,
._semphr_create = semphr_create_wrapper, ._semphr_create = semphr_create_wrapper,
._semphr_give_from_isr = semphr_give_from_isr_wrapper, ._semphr_give_from_isr = semphr_give_from_isr_wrapper,
._semphr_take = semphr_take_wrapper, ._semphr_take = semphr_take_wrapper,

@ -1 +1 @@
Subproject commit 8f6c2c5481d30342be8f69067a68ca7344d7b0c3 Subproject commit e1f7dbc3bd717e142ca6c717b82a7a813c1e36f4