mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 14:34:54 +01:00
last tv compilation error
This commit is contained in:
parent
3d351ce6c5
commit
db3266ac48
1 changed files with 3 additions and 1 deletions
|
@ -37,7 +37,7 @@ void SNTPComponent::setup() {
|
||||||
}
|
}
|
||||||
sntp_setoperatingmode(SNTP_OPMODE_POLL);
|
sntp_setoperatingmode(SNTP_OPMODE_POLL);
|
||||||
g_sync_callback = [this](struct timeval *tv) {
|
g_sync_callback = [this](struct timeval *tv) {
|
||||||
static struct timeval time_val = tv ? *tv : {};
|
static struct timeval time_val;
|
||||||
switch (sntp_get_sync_status()) {
|
switch (sntp_get_sync_status()) {
|
||||||
case SNTP_SYNC_STATUS_RESET:
|
case SNTP_SYNC_STATUS_RESET:
|
||||||
ESP_LOGD(TAG, "Time sync reset");
|
ESP_LOGD(TAG, "Time sync reset");
|
||||||
|
@ -50,6 +50,8 @@ void SNTPComponent::setup() {
|
||||||
ESP_LOGD(TAG, "Time sync in progress");
|
ESP_LOGD(TAG, "Time sync in progress");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (tv)
|
||||||
|
time_val = *tv;
|
||||||
};
|
};
|
||||||
sntp_set_time_sync_notification_cb(sntp_sync_time_cb);
|
sntp_set_time_sync_notification_cb(sntp_sync_time_cb);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue