File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1111#include "system/event.h"
1212#include "user/gui_daemon.h"
1313#include "user/led_daemon.h"
14+ #include "user/ota_update.h"
1415
1516#define TAG "ntp"
1617
@@ -73,10 +74,7 @@ void ntp_daemon(void *pvParameter)
7374 time (& now );
7475 localtime_r (& now , & timeinfo );
7576 if (timeinfo .tm_hour == 0 && timeinfo .tm_min == 0 ) {
76- ESP_LOGW (TAG , "scheduled reboot..." );
77- gui_show_image (4 );
78- vTaskDelay (2000 / portTICK_RATE_MS );
79- esp_restart ();
77+ ota_check_update ();
8078 }
8179 }
8280}
@@ -85,10 +83,12 @@ void ntp_sync_time(void)
8583{
8684 EventBits_t uxBits = xEventGroupGetBits (daemon_event_group );
8785 if ((uxBits & NTP_DAEMON_FINISH_BIT ) == 0 ) {
88- xEventGroupSync (
86+ xEventGroupSetBits (daemon_event_group , NTP_DAEMON_READY_BIT );
87+ xEventGroupWaitBits (
8988 daemon_event_group ,
90- NTP_DAEMON_READY_BIT ,
9189 NTP_DAEMON_FINISH_BIT ,
90+ pdFALSE ,
91+ pdFALSE ,
9292 portMAX_DELAY
9393 );
9494 }
You can’t perform that action at this time.
0 commit comments