diff --git a/components/bt/Kconfig b/components/bt/Kconfig index e4a72654fa..1dd04bb0b1 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -3,7 +3,7 @@ menuconfig BT_ENABLED help Select this option to enable Bluetooth stack and show the submenu with Bluetooth configuration choices. -config ESP_MAC_OFFSET_BT_ +config ESP_MAC_OFFSET_BT int "MAC address offset value of WiFi station" depends on BT_ENABLED range 0 255 diff --git a/components/bt/bt.c b/components/bt/bt.c index 4943b9acbf..9af9dd0edd 100644 --- a/components/bt/bt.c +++ b/components/bt/bt.c @@ -45,6 +45,7 @@ extern void btdm_controller_deinit(void); extern int btdm_controller_enable(esp_bt_mode_t mode); extern int btdm_controller_disable(esp_bt_mode_t mode); extern void btdm_rf_bb_init(void); +extern int esp_read_mac(uint8_t *mac, int type); /* VHCI function interface */ typedef struct vhci_host_callback { @@ -78,7 +79,7 @@ struct osi_funcs_t { 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]); + int32_t (* _read_efuse_mac)(uint8_t mac[6]); }; /* Static variable declare */ @@ -129,6 +130,11 @@ static int32_t IRAM_ATTR mutex_unlock_wrapper(void *mutex) return (int32_t)xSemaphoreGive(mutex); } +static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6]) +{ + return esp_read_mac(mac, ESP_MAC_BT); +} + static struct osi_funcs_t osi_funcs = { ._set_isr = xt_set_interrupt_handler, ._ints_on = xt_ints_on, @@ -141,7 +147,7 @@ static struct osi_funcs_t osi_funcs = { ._mutex_create = mutex_create_wrapper, ._mutex_lock = mutex_lock_wrapper, ._mutex_unlock = mutex_unlock_wrapper, - ._read_efuse_mac = esp_efuse_read_mac, + ._read_efuse_mac = read_mac_wrapper }; bool esp_vhci_host_check_send_available(void) diff --git a/components/bt/lib b/components/bt/lib index 9f9f6a004e..9a4bb1d528 160000 --- a/components/bt/lib +++ b/components/bt/lib @@ -1 +1 @@ -Subproject commit 9f9f6a004e42519f54555c42a037b8ef25bf2238 +Subproject commit 9a4bb1d5287572664f170f9df4dbfd71babdfc68 diff --git a/components/esp32/system_api.c b/components/esp32/system_api.c index 36b8b6b588..7f1243f5db 100644 --- a/components/esp32/system_api.c +++ b/components/esp32/system_api.c @@ -97,13 +97,13 @@ esp_err_t esp_read_mac(uint8_t* mac, int interface) break; #endif #if CONFIG_BT_ENABLED - case ESP_MAC_WIFI_BT: + case ESP_MAC_BT: memcpy(mac, efuse_mac, 6); mac[5] += CONFIG_ESP_MAC_OFFSET_BT; break; #endif #if CONFIG_ETHERNET - case ESP_MAC_WIFI_ETH: + case ESP_MAC_ETH: memcpy(mac, efuse_mac, 6); mac[5] += CONFIG_ESP_MAC_OFFSET_ETH; break;