Skip to content

Commit 51f2c49

Browse files
committed
bt_app_spp: add restart countdown
1 parent 875e60b commit 51f2c49

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main/src/user/bt_app_spp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ void bt_app_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
8080

8181
EventBits_t uxBits = xEventGroupGetBits(user_event_group);
8282
if (uxBits & BT_OTA_RESTART_BIT) {
83-
ESP_LOGW(BT_SPP_TAG, "restart pending...");
83+
for (int i=3; i>0; i--) {
84+
ESP_LOGW(BT_SPP_TAG, "restart countdown...%d", i);
8485

85-
vTaskDelay(2000 / portTICK_RATE_MS);
86+
vTaskDelay(1000 / portTICK_RATE_MS);
87+
}
8688

8789
ESP_LOGW(BT_SPP_TAG, "restart now");
8890
esp_restart();

0 commit comments

Comments
 (0)