Merge branch 'bugfix/btdm_fix_ble_throughput_demo_fail' into 'master'
Component/bt: fix throughput_demo_fail See merge request idf/esp-idf!2467
This commit is contained in:
commit
a3a0b01c1b
5 changed files with 15 additions and 10 deletions
|
@ -604,6 +604,8 @@ static bool IRAM_ATTR btdm_sleep_check_duration(uint32_t *slot_cnt)
|
||||||
if (*slot_cnt < BTDM_MIN_SLEEP_DURATION) {
|
if (*slot_cnt < BTDM_MIN_SLEEP_DURATION) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/* wake up 3 slots in advance */
|
||||||
|
*slot_cnt = *slot_cnt -3;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -835,9 +837,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
||||||
|
|
||||||
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
|
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
|
||||||
btdm_lpcycle_us = 32 << btdm_lpcycle_us_frac;
|
btdm_lpcycle_us = 32 << btdm_lpcycle_us_frac;
|
||||||
|
#if CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG
|
||||||
bool select_src_ret = false;
|
bool select_src_ret = false;
|
||||||
bool set_div_ret = false;
|
bool set_div_ret = false;
|
||||||
#if CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG
|
|
||||||
#if CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL
|
#if CONFIG_BTDM_LPCLK_SEL_MAIN_XTAL
|
||||||
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
|
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
|
||||||
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get() * 32 - 1);
|
set_div_ret = btdm_lpclk_set_div(rtc_clk_xtal_freq_get() * 32 - 1);
|
||||||
|
|
|
@ -482,6 +482,7 @@ static void throughput_client_task(void *param)
|
||||||
while(1) {
|
while(1) {
|
||||||
#if (CONFIG_GATTS_NOTIFY_THROUGHPUT)
|
#if (CONFIG_GATTS_NOTIFY_THROUGHPUT)
|
||||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||||
|
if(is_connecet){
|
||||||
uint32_t bit_rate = 0;
|
uint32_t bit_rate = 0;
|
||||||
if (start_time) {
|
if (start_time) {
|
||||||
current_time = esp_timer_get_time();
|
current_time = esp_timer_get_time();
|
||||||
|
@ -491,6 +492,7 @@ static void throughput_client_task(void *param)
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGI(GATTC_TAG, "Notify Bit rate = 0 Btye/s, = 0 bit/s");
|
ESP_LOGI(GATTC_TAG, "Notify Bit rate = 0 Btye/s, = 0 bit/s");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */
|
#endif /* #if (CONFIG_GATTS_NOTIFY_THROUGHPUT) */
|
||||||
#if (CONFIG_GATTC_WRITE_THROUGHPUT)
|
#if (CONFIG_GATTC_WRITE_THROUGHPUT)
|
||||||
if (!can_send_write) {
|
if (!can_send_write) {
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
# by default in this example
|
# by default in this example
|
||||||
CONFIG_BT_ENABLED=y
|
CONFIG_BT_ENABLED=y
|
||||||
CONFIG_GATTS_NOTIFY_THROUGHPUT=y
|
CONFIG_GATTS_NOTIFY_THROUGHPUT=y
|
||||||
|
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
|
||||||
|
|
|
@ -611,7 +611,6 @@ void throughput_server_task(void *param)
|
||||||
while(1) {
|
while(1) {
|
||||||
#if (CONFIG_GATTS_NOTIFY_THROUGHPUT)
|
#if (CONFIG_GATTS_NOTIFY_THROUGHPUT)
|
||||||
if (!can_send_notify) {
|
if (!can_send_notify) {
|
||||||
ESP_LOGI(GATTS_TAG, "===");
|
|
||||||
int res = xSemaphoreTake(gatts_semaphore, portMAX_DELAY);
|
int res = xSemaphoreTake(gatts_semaphore, portMAX_DELAY);
|
||||||
assert(res == pdTRUE);
|
assert(res == pdTRUE);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
# by default in this example
|
# by default in this example
|
||||||
CONFIG_BT_ENABLED=y
|
CONFIG_BT_ENABLED=y
|
||||||
CONFIG_GATTS_NOTIFY_THROUGHPUT=y
|
CONFIG_GATTS_NOTIFY_THROUGHPUT=y
|
||||||
|
CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=n
|
||||||
|
|
Loading…
Reference in a new issue