Merge branch 'feature/btdm_controller' into 'master'

bluetooth controller update

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

See merge request !117
This commit is contained in:
Ivan Grokhotkov 2016-09-27 22:20:37 +08:00
commit b77bf9bc90
2 changed files with 41 additions and 6 deletions

View File

@ -53,8 +53,11 @@ struct osi_funcs_t {
void (*_interrupt_restore)(void);
void (*_task_yield)(void);
void *(*_semphr_create)(uint32_t max, uint32_t init);
void *(*_semphr_give_from_isr)(void *semphr, void *hptw);
void *(*_semphr_take)(void *semphr, uint32_t block_time);
int32_t (*_semphr_give_from_isr)(void *semphr, void *hptw);
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]);
};
@ -70,9 +73,34 @@ static void IRAM_ATTR interrupt_restore(void)
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 = {
@ -81,9 +109,12 @@ static struct osi_funcs_t osi_funcs = {
._interrupt_disable = interrupt_disable,
._interrupt_restore = interrupt_restore,
._task_yield = vPortYield,
._semphr_create = xQueueCreateCountingSemaphore,
._semphr_give_from_isr = (void *)xQueueGiveFromISR,
._semphr_create = semphr_create_wrapper,
._semphr_give_from_isr = semphr_give_from_isr_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,
};

View File

@ -99,6 +99,10 @@ PROVIDE ( _data_end = 0x4000d5c8 );
PROVIDE ( _data_end_btdm_rom = 0x4000d4f8 );
PROVIDE ( _data_start = 0x4000d4f8 );
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 ( dbg_default_handler = 0x3ff97218 );
PROVIDE ( dbg_state = 0x3ffb8d5d );