From d6f857a2f0262244b9ed32be20df49f1ab76f4bc Mon Sep 17 00:00:00 2001 From: xiongweichao Date: Thu, 5 May 2022 10:50:33 +0800 Subject: [PATCH] Fix ESP32C3 build error after enable light sleep --- components/bt/controller/esp32c3/bt.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index 440e90cab9..a2c8fcac1b 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -894,25 +894,21 @@ void esp_release_wifi_and_coex_mem(void) ESP_ERROR_CHECK(try_heap_caps_add_region((intptr_t)ets_rom_layout_p->data_start_interface_coexist,(intptr_t)ets_rom_layout_p->bss_end_interface_pp)); } -#if CONFIG_FREERTOS_USE_TICKLESS_IDLE +#if CONFIG_MAC_BB_PD static void IRAM_ATTR btdm_mac_bb_power_down_cb(void) { if (s_lp_cntl.mac_bb_pd && s_lp_stat.mac_bb_pd == 0) { -#if (CONFIG_MAC_BB_PD) btdm_ble_power_down_dma_copy(true); -#endif s_lp_stat.mac_bb_pd = 1; } } static void IRAM_ATTR btdm_mac_bb_power_up_cb(void) { -#if (CONFIG_MAC_BB_PD) if (s_lp_cntl.mac_bb_pd && s_lp_stat.mac_bb_pd) { btdm_ble_power_down_dma_copy(false); s_lp_stat.mac_bb_pd = 0; } -#endif } #endif @@ -995,7 +991,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) s_lp_cntl.no_light_sleep = 1; if (s_lp_cntl.enable) { -#if (CONFIG_MAC_BB_PD) +#if CONFIG_MAC_BB_PD if (!btdm_deep_sleep_mem_init()) { err = ESP_ERR_NO_MEM; goto error; @@ -1040,7 +1036,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg) ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n" "light sleep mode will not be able to apply when bluetooth is enabled"); } -#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW) +#elif CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW // check whether or not EXT_CRYS is working if (rtc_clk_slow_freq_get() == RTC_SLOW_FREQ_RTC) { s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator @@ -1141,7 +1137,7 @@ error: s_btdm_slp_tmr = NULL; } -#if (CONFIG_MAC_BB_PD) +#if CONFIG_MAC_BB_PD if (s_lp_cntl.mac_bb_pd) { btdm_deep_sleep_mem_deinit(); s_lp_cntl.mac_bb_pd = 0; @@ -1187,7 +1183,7 @@ esp_err_t esp_bt_controller_deinit(void) // deinit low power control resources do { -#if (CONFIG_MAC_BB_PD) +#if CONFIG_MAC_BB_PD btdm_deep_sleep_mem_deinit(); #endif