esp32: update code for component/bt/lib @ 0986936

This commit is contained in:
Matthias Ringwald 2017-04-19 22:07:23 +02:00
parent 612e8fb6c9
commit 40e336b75a
2 changed files with 36 additions and 6 deletions

View File

@ -105,16 +105,31 @@ static void transport_notify_packet_send(void *arg){
transport_packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event));
}
void report_recv_called_from_isr(void){
printf("host_recv_pkt_cb called from ISR!\n");
}
// run from VHCI Task
static void host_send_pkt_available_cb(void){
// notify upper stack that provided buffer can be used again
btstack_run_loop_freertos_single_threaded_execute_code_on_main_thread(&transport_notify_packet_send, NULL);
if (xPortInIsrContext()){
// notify upper stack that provided buffer can be used again
btstack_run_loop_freertos_single_threaded_execute_code_on_main_thread_from_isr(&transport_notify_packet_send, NULL);
} else {
// notify upper stack that provided buffer can be used again
btstack_run_loop_freertos_single_threaded_execute_code_on_main_thread(&transport_notify_packet_send, NULL);
}
}
// run from VHCI Task
static int host_recv_pkt_cb(uint8_t *data, uint16_t len){
// log_info("host_recv_pkt_cb: %u bytes, type %u, begins %02x %02x", len, data[0], data[1], data[2]);
if (xPortInIsrContext()){
report_recv_called_from_isr();
return 0;
}
xSemaphoreTake(ring_buffer_mutex, portMAX_DELAY);
// check space
@ -157,6 +172,7 @@ static void transport_init(const void *transport_config){
/**
* open transport connection
*/
static int transport_open(void){
esp_err_t ret;
@ -164,11 +180,17 @@ static int transport_open(void){
btstack_ring_buffer_init(&hci_ringbuffer, hci_ringbuffer_storage, sizeof(hci_ringbuffer_storage));
esp_bt_controller_init();
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
ret = esp_bt_controller_init(&bt_cfg);
if (ret) {
log_error("transport: esp_bt_controller_init failed");
return -1;
}
ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM);
if (ret) {
log_error("transpprt: esp_bt_controller_enable failed");
log_error("transport: esp_bt_controller_enable failed");
return -1;
}

View File

@ -91,9 +91,9 @@ CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
# CONFIG_AWS_IOT_SDK is not set
CONFIG_BT_ENABLED=y
# CONFIG_BLUEDROID_ENABLED is not set
CONFIG_BTC_TASK_STACK_SIZE=3072
# CONFIG_BLUEDROID_MEM_DEBUG is not set
# CONFIG_BT_DRAM_RELEASE is not set
CONFIG_BTDM_CONTROLLER_RUN_CPU=0
# CONFIG_BT_HCI_UART is not set
CONFIG_BT_RESERVE_DRAM=0x10000
#
@ -105,6 +105,8 @@ CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
CONFIG_MEMMAP_SMP=y
# CONFIG_MEMMAP_TRACEMEM is not set
# CONFIG_MEMMAP_TRACEMEM_TWOBANKS is not set
# CONFIG_ESP32_TRAX is not set
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set
CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y
@ -112,6 +114,10 @@ CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=y
CONFIG_ESP32_ENABLE_COREDUMP=y
CONFIG_ESP32_CORE_DUMP_UART_DELAY=0
CONFIG_ESP32_CORE_DUMP_LOG_LEVEL=1
# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set
# CONFIG_ESP32_APPTRACE_DEST_UART is not set
CONFIG_ESP32_APPTRACE_DEST_NONE=y
# CONFIG_ESP32_APPTRACE_ENABLE is not set
# CONFIG_TWO_MAC_ADDRESS_FROM_EFUSE is not set
CONFIG_FOUR_MAC_ADDRESS_FROM_EFUSE=y
CONFIG_NUMBER_OF_MAC_ADDRESS_GENERATED_FROM_EFUSE=4
@ -143,6 +149,7 @@ CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y
# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set
# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y
# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set
CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=0
# CONFIG_WIFI_ENABLED is not set
CONFIG_PHY_ENABLED=y
@ -261,3 +268,4 @@ CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
# SPI Flash driver
#
# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y