From 5a438310061961910e05df5a93e259d9a0a78a4a Mon Sep 17 00:00:00 2001 From: alanmaxwell Date: Tue, 31 Oct 2023 16:13:01 +0800 Subject: [PATCH 1/2] fix(wifi): Fix bug using CONFIG_WIFI_ENABLED macro --- components/esp_phy/src/phy_common.c | 8 ++++---- components/esp_phy/test/test_phy_rtc.c | 2 +- .../classic_bt/bt_spp_acceptor/sdkconfig.defaults | 2 +- .../classic_bt/bt_spp_initiator/sdkconfig.defaults | 2 +- .../classic_bt/bt_spp_vfs_acceptor/sdkconfig.defaults | 2 +- .../classic_bt/bt_spp_vfs_initiator/sdkconfig.defaults | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/esp_phy/src/phy_common.c b/components/esp_phy/src/phy_common.c index d28745b8e8..ad4a3b388e 100644 --- a/components/esp_phy/src/phy_common.c +++ b/components/esp_phy/src/phy_common.c @@ -13,7 +13,7 @@ static volatile uint16_t s_phy_modem_flag = 0; extern void phy_param_track_tot(bool en_wifi, bool en_ble_154); static esp_timer_handle_t phy_track_pll_timer; -#if CONFIG_WIFI_ENABLED +#if CONFIG_ESP_WIFI_ENABLED static volatile int64_t s_wifi_prev_timestamp; #endif #if CONFIG_IEEE802154_ENABLED || CONFIG_BT_ENABLED @@ -21,7 +21,7 @@ static volatile int64_t s_bt_154_prev_timestamp; #endif #define PHY_TRACK_PLL_PERIOD_IN_US 1000000 -#if CONFIG_IEEE802154_ENABLED || CONFIG_BT_ENABLED || CONFIG_WIFI_ENABLED +#if CONFIG_IEEE802154_ENABLED || CONFIG_BT_ENABLED || CONFIG_ESP_WIFI_ENABLED bool phy_enabled_modem_contains(esp_phy_modem_t modem) { return (s_phy_modem_flag & modem) != 0; @@ -32,7 +32,7 @@ static void phy_track_pll(void) { bool wifi_track_pll = false; bool ble_154_track_pll = false; -#if CONFIG_WIFI_ENABLED +#if CONFIG_ESP_WIFI_ENABLED if (phy_enabled_modem_contains(PHY_MODEM_WIFI)) { wifi_track_pll = true; s_wifi_prev_timestamp = esp_timer_get_time(); @@ -64,7 +64,7 @@ void phy_track_pll_init(void) // Using a variable to record the previously tracked time when PLL was last called. // If the duration is larger than PHY_TRACK_PLL_PERIOD_IN_US, then track PLL. bool need_track_pll = false; -#if CONFIG_WIFI_ENABLED +#if CONFIG_ESP_WIFI_ENABLED need_track_pll = need_track_pll || ((esp_timer_get_time() - s_wifi_prev_timestamp) > PHY_TRACK_PLL_PERIOD_IN_US); #endif #if CONFIG_IEEE802154_ENABLED || CONFIG_BT_ENABLED diff --git a/components/esp_phy/test/test_phy_rtc.c b/components/esp_phy/test/test_phy_rtc.c index 7cfe722722..1d653ce15c 100644 --- a/components/esp_phy/test/test_phy_rtc.c +++ b/components/esp_phy/test/test_phy_rtc.c @@ -46,7 +46,7 @@ static void test_phy_rtc_init(void) ret = nvs_flash_init(); } TEST_ESP_OK(ret); -#if CONFIG_WIFI_ENABLED +#if CONFIG_ESP_WIFI_ENABLED esp_phy_enable(PHY_MODEM_WIFI); #endif #if CONFIG_BT_ENABLED diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/sdkconfig.defaults b/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/sdkconfig.defaults index a303599521..1974e0e8cb 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_acceptor/sdkconfig.defaults @@ -5,6 +5,6 @@ CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_CLASSIC_ENABLED=y -CONFIG_WIFI_ENABLED=n +CONFIG_ESP_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y CONFIG_BT_BLE_ENABLED=n diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/sdkconfig.defaults b/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/sdkconfig.defaults index a303599521..1974e0e8cb 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_initiator/sdkconfig.defaults @@ -5,6 +5,6 @@ CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_CLASSIC_ENABLED=y -CONFIG_WIFI_ENABLED=n +CONFIG_ESP_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y CONFIG_BT_BLE_ENABLED=n diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/sdkconfig.defaults b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/sdkconfig.defaults index a303599521..1974e0e8cb 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/sdkconfig.defaults @@ -5,6 +5,6 @@ CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_CLASSIC_ENABLED=y -CONFIG_WIFI_ENABLED=n +CONFIG_ESP_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y CONFIG_BT_BLE_ENABLED=n diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/sdkconfig.defaults b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/sdkconfig.defaults index a303599521..1974e0e8cb 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/sdkconfig.defaults +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/sdkconfig.defaults @@ -5,6 +5,6 @@ CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_CLASSIC_ENABLED=y -CONFIG_WIFI_ENABLED=n +CONFIG_ESP_WIFI_ENABLED=n CONFIG_BT_SPP_ENABLED=y CONFIG_BT_BLE_ENABLED=n From ce5cd8bf7542f3a3857cac83e4082d907138eac8 Mon Sep 17 00:00:00 2001 From: alanmaxwell Date: Mon, 30 Oct 2023 14:26:25 +0800 Subject: [PATCH 2/2] fix(phy): Fix ESP32C6 rx pkts fail in light sleep mode --- components/esp_phy/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_phy/lib b/components/esp_phy/lib index 8673ea44a5..9af837d5a5 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit 8673ea44a5aebaf46b7c95251ed3392bce549433 +Subproject commit 9af837d5a581f502d7d5b1b5829a5c008c048be4