|
@@ -45,11 +45,11 @@ static uint8_t max(uint8_t a, uint8_t b) {
|
|
return (a > b) ? a : b;
|
|
return (a > b) ? a : b;
|
|
}
|
|
}
|
|
|
|
|
|
-static uint8_t determine_sleep_time(struct tm *local_time) {
|
|
|
|
|
|
+static uint16_t determine_sleep_time(struct tm *local_time) {
|
|
uint8_t wakeup_time_sec;
|
|
uint8_t wakeup_time_sec;
|
|
wakeup_time_sec = 60 - local_time->tm_sec;
|
|
wakeup_time_sec = 60 - local_time->tm_sec;
|
|
wakeup_time_sec = max(wakeup_time_sec, 1);
|
|
wakeup_time_sec = max(wakeup_time_sec, 1);
|
|
- return wakeup_time_sec;
|
|
|
|
|
|
+ return wakeup_time_sec * 1000;
|
|
}
|
|
}
|
|
|
|
|
|
void display_update_task(void *pvParameters) {
|
|
void display_update_task(void *pvParameters) {
|
|
@@ -57,6 +57,8 @@ void display_update_task(void *pvParameters) {
|
|
while(1) {
|
|
while(1) {
|
|
ds3231_read_date_time(¤t_time);
|
|
ds3231_read_date_time(¤t_time);
|
|
struct tm *local_time = convert_to_local(¤t_time);
|
|
struct tm *local_time = convert_to_local(¤t_time);
|
|
|
|
+ setenv("TZ", "GMT+0GMT+0", 1);
|
|
|
|
+ tzset();
|
|
update_display(local_time->tm_hour, local_time->tm_min);
|
|
update_display(local_time->tm_hour, local_time->tm_min);
|
|
vTaskDelay(determine_sleep_time(local_time) / portTICK_PERIOD_MS);
|
|
vTaskDelay(determine_sleep_time(local_time) / portTICK_PERIOD_MS);
|
|
}
|
|
}
|