From 0bf641a17cd71cb07bd194f3e984a4ad1bb9698b Mon Sep 17 00:00:00 2001 From: Chen Jian Hua Date: Fri, 27 Sep 2024 18:33:43 +0800 Subject: [PATCH 1/2] fix(bt/controller): Fixed the timeout of wake up timer when using RC OSC (cherry picked from commit 873708579c99069d073f3d6c7ba6db154cbf16b9) Co-authored-by: chenjianhua --- components/bt/controller/esp32c3/bt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index ca3766b1aa4d..8953dd23f713 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -781,7 +781,8 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles) // allow a maximum time uncertainty to be about 488ppm(1/2048) at least as clock drift // and set the timer in advance uint32_t uncertainty = (us_to_sleep >> 11); -#if CONFIG_FREERTOS_USE_TICKLESS_IDLE +#if CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP + // recalculate clock drift when Bluetooth using main XTAL during light sleep if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) { uncertainty = us_to_sleep * BTDM_RTC_SLOW_CLK_RC_DRIFT_PERCENT / 100; } From 8fa51aa1b558344c01f089ef3809264ca9f93472 Mon Sep 17 00:00:00 2001 From: Chen Jian Hua Date: Fri, 27 Sep 2024 18:33:45 +0800 Subject: [PATCH 2/2] fix(bt/controller): Fixed ble get tx power error (cherry picked from commit 4108a5cc4cb96039ed861703dda06f7f3a5969c3) Co-authored-by: chenjianhua --- components/bt/controller/esp32c3/bt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/controller/esp32c3/bt.c b/components/bt/controller/esp32c3/bt.c index 8953dd23f713..771d3f29332c 100644 --- a/components/bt/controller/esp32c3/bt.c +++ b/components/bt/controller/esp32c3/bt.c @@ -1754,7 +1754,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type) handle = power_type; } - lvl = (esp_power_level_t)ble_txpwr_get(power_type, handle); + lvl = (esp_power_level_t)ble_txpwr_get(enh_pwr_type, handle); return lvl; }