mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt: add VHCI mutex protetion
1. add mutex to VHCI APIs 2. remove bss/data log print during initialization; 3. add bss/data symbols in esp32.rom.ld 4. add & modify BTDM OSI functions
This commit is contained in:
parent
4480ab6c8c
commit
b9167f70cd
@ -56,8 +56,11 @@ struct osi_funcs_t {
|
|||||||
void (*_interrupt_restore)(void);
|
void (*_interrupt_restore)(void);
|
||||||
void (*_task_yield)(void);
|
void (*_task_yield)(void);
|
||||||
void *(*_semphr_create)(uint32_t max, uint32_t init);
|
void *(*_semphr_create)(uint32_t max, uint32_t init);
|
||||||
void *(*_semphr_give_from_isr)(void *semphr, void *hptw);
|
int32_t (*_semphr_give_from_isr)(void *semphr, void *hptw);
|
||||||
void *(*_semphr_take)(void *semphr, uint32_t block_time);
|
int32_t (*_semphr_take)(void *semphr, uint32_t block_time_ms);
|
||||||
|
void *(*_mutex_create)(void);
|
||||||
|
int32_t (*_mutex_lock)(void *mutex);
|
||||||
|
int32_t (*_mutex_unlock)(void *mutex);
|
||||||
esp_err_t (* _read_efuse_mac)(uint8_t mac[6]);
|
esp_err_t (* _read_efuse_mac)(uint8_t mac[6]);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -73,9 +76,34 @@ static void IRAM_ATTR interrupt_restore(void)
|
|||||||
portEXIT_CRITICAL(&global_int_mux);
|
portEXIT_CRITICAL(&global_int_mux);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void * IRAM_ATTR semphr_take_wrapper(void *semphr, uint32_t block_time)
|
static void * IRAM_ATTR semphr_create_wrapper(uint32_t max, uint32_t init)
|
||||||
{
|
{
|
||||||
return (void *)xSemaphoreTake(semphr, block_time);
|
return (void *)xSemaphoreCreateCounting(max, init);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t IRAM_ATTR semphr_give_from_isr_wrapper(void *semphr, void *hptw)
|
||||||
|
{
|
||||||
|
return (int32_t)xSemaphoreGiveFromISR(semphr, hptw);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t IRAM_ATTR semphr_take_wrapper(void *semphr, uint32_t block_time_ms)
|
||||||
|
{
|
||||||
|
return (int32_t)xSemaphoreTake(semphr, block_time_ms / portTICK_RATE_MS);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void * IRAM_ATTR mutex_create_wrapper(void)
|
||||||
|
{
|
||||||
|
return (void *)xSemaphoreCreateMutex();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t IRAM_ATTR mutex_lock_wrapper(void *mutex)
|
||||||
|
{
|
||||||
|
return (int32_t)xSemaphoreTake(mutex, portMAX_DELAY);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t IRAM_ATTR mutex_unlock_wrapper(void *mutex)
|
||||||
|
{
|
||||||
|
return (int32_t)xSemaphoreGive(mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct osi_funcs_t osi_funcs = {
|
static struct osi_funcs_t osi_funcs = {
|
||||||
@ -84,9 +112,12 @@ 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,
|
||||||
._semphr_create = xQueueCreateCountingSemaphore,
|
._semphr_create = semphr_create_wrapper,
|
||||||
._semphr_give_from_isr = (void *)xQueueGiveFromISR,
|
._semphr_give_from_isr = semphr_give_from_isr_wrapper,
|
||||||
._semphr_take = semphr_take_wrapper,
|
._semphr_take = semphr_take_wrapper,
|
||||||
|
._mutex_create = mutex_create_wrapper,
|
||||||
|
._mutex_lock = mutex_lock_wrapper,
|
||||||
|
._mutex_unlock = mutex_unlock_wrapper,
|
||||||
._read_efuse_mac = system_efuse_read_mac,
|
._read_efuse_mac = system_efuse_read_mac,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,6 +99,10 @@ PROVIDE ( _data_end = 0x4000d5c8 );
|
|||||||
PROVIDE ( _data_end_btdm_rom = 0x4000d4f8 );
|
PROVIDE ( _data_end_btdm_rom = 0x4000d4f8 );
|
||||||
PROVIDE ( _data_start = 0x4000d4f8 );
|
PROVIDE ( _data_start = 0x4000d4f8 );
|
||||||
PROVIDE ( _data_start_btdm_rom = 0x4000d4f4 );
|
PROVIDE ( _data_start_btdm_rom = 0x4000d4f4 );
|
||||||
|
PROVIDE ( _data_start_btdm = 0x3ffae6e0);
|
||||||
|
PROVIDE ( _data_end_btdm = 0x3ffaff10);
|
||||||
|
PROVIDE ( _bss_start_btdm = 0x3ffb8000);
|
||||||
|
PROVIDE ( _bss_end_btdm = 0x3ffbff70);
|
||||||
PROVIDE ( _daylight = 0x3ffae0a4 );
|
PROVIDE ( _daylight = 0x3ffae0a4 );
|
||||||
PROVIDE ( dbg_default_handler = 0x3ff97218 );
|
PROVIDE ( dbg_default_handler = 0x3ff97218 );
|
||||||
PROVIDE ( dbg_state = 0x3ffb8d5d );
|
PROVIDE ( dbg_state = 0x3ffb8d5d );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user