Add notes

This commit is contained in:
gengyuchao 2020-01-10 20:29:15 +08:00
parent ed6805625c
commit ef07a315bb
2 changed files with 6 additions and 4 deletions

View file

@ -516,7 +516,7 @@ static void throughput_client_task(void *param)
ESP_GATT_WRITE_TYPE_NO_RSP,
ESP_GATT_AUTH_REQ_NONE);
}
} else { //you can delete the else for the fast speed
} else { //Add the vTaskDelay to prevent this task from consuming the CPU all the time, causing low-priority tasks to not be executed at all.
vTaskDelay( 10 / portTICK_PERIOD_MS );
}
}
@ -586,7 +586,8 @@ void app_main()
if (local_mtu_ret){
ESP_LOGE(GATTC_TAG, "set local MTU failed, error code = %x", local_mtu_ret);
}
// The task is only created on the CPU core that Bluetooth is working on,
// preventing the sending task from using the un-updated Bluetooth state on another CPU.
xTaskCreatePinnedToCore(&throughput_client_task, "throughput_client_task", 4096, NULL, 10, NULL, BLUETOOTH_TASK_PINNED_TO_CORE);
#if (CONFIG_GATTC_WRITE_THROUGHPUT)

View file

@ -631,7 +631,7 @@ void throughput_server_task(void *param)
gl_profile_tab[PROFILE_A_APP_ID].char_handle,
sizeof(indicate_data), indicate_data, false);
}
} else { //you can delete the else for the fast speed
} else { //Add the vTaskDelay to prevent this task from consuming the CPU all the time, causing low-priority tasks to not be executed at all.
vTaskDelay( 10 / portTICK_PERIOD_MS );
}
}
@ -711,7 +711,8 @@ void app_main()
if (local_mtu_ret){
ESP_LOGE(GATTS_TAG, "set local MTU failed, error code = %x", local_mtu_ret);
}
// The task is only created on the CPU core that Bluetooth is working on,
// preventing the sending task from using the un-updated Bluetooth state on another CPU.
xTaskCreatePinnedToCore(&throughput_server_task, "throughput_server_task", 4096, NULL, 15, NULL, BLUETOOTH_TASK_PINNED_TO_CORE);
#if (CONFIG_EXAMPLE_GATTS_NOTIFY_THROUGHPUT)
gatts_semaphore = xSemaphoreCreateBinary();