Skip to content

Commit 29b22e0

Browse files
committed
os: reduce sleep/reset delay
1 parent ed77bae commit 29b22e0

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

main/src/core/os.c

+4-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "freertos/FreeRTOS.h"
1212
#include "freertos/event_groups.h"
1313
#include "freertos/task.h"
14+
1415
#include "driver/rtc_io.h"
1516

1617
#include "core/os.h"
@@ -37,13 +38,11 @@ static void os_power_task_handle(void *pvParameters)
3738
portMAX_DELAY
3839
);
3940

41+
ESP_LOGW(OS_PWR_TAG, "waiting for unfinished jobs....");
42+
vTaskDelay(500 / portTICK_RATE_MS);
43+
4044
EventBits_t uxBits = xEventGroupGetBits(user_event_group);
4145
if (uxBits & OS_PWR_SLEEP_BIT) {
42-
for (int i=3; i>0; i--) {
43-
ESP_LOGW(OS_PWR_TAG, "sleeping in %ds", i);
44-
vTaskDelay(1000 / portTICK_RATE_MS);
45-
}
46-
4746
xEventGroupWaitBits(
4847
user_event_group,
4948
sleep_wait_bits,
@@ -69,11 +68,6 @@ static void os_power_task_handle(void *pvParameters)
6968
ESP_LOGW(OS_PWR_TAG, "sleep now");
7069
esp_deep_sleep_start();
7170
} else if (uxBits & OS_PWR_RESTART_BIT) {
72-
for (int i=3; i>0; i--) {
73-
ESP_LOGW(OS_PWR_TAG, "restarting in %ds", i);
74-
vTaskDelay(1000 / portTICK_RATE_MS);
75-
}
76-
7771
xEventGroupWaitBits(
7872
user_event_group,
7973
restart_wait_bits,

0 commit comments

Comments
 (0)