Kaynağa Gözat

time_display: Remove conversion code moved to time_conversion

Helmut Pozimski 1 yıl önce
ebeveyn
işleme
b8bbe30076
1 değiştirilmiş dosya ile 1 ekleme ve 12 silme
  1. 1 12
      main/time_display.c

+ 1 - 12
main/time_display.c

@@ -12,7 +12,7 @@
 
 #include "tm1637.h"
 #include "ds3231.h"
-#include "configuration.h"
+#include "time_conversion.h"
 
 static void update_display(uint8_t hour, uint8_t minute) {
     if (hour < 10) {
@@ -32,15 +32,6 @@ static void update_display(uint8_t hour, uint8_t minute) {
     }
 }
 
-static struct tm *convert_to_local(struct tm *timeinfo) {
-    setenv("TZ", "GMT+0GMT+0", 1);
-    tzset();
-    time_t epoch_time = mktime(timeinfo);
-    setenv("TZ", LOCAL_TIMEZONE, 1);
-    tzset();
-    return localtime(&epoch_time);
-}
-
 static uint8_t max(uint8_t a, uint8_t b) {
     return (a > b) ? a : b;
 }
@@ -57,8 +48,6 @@ void display_update_task(void *pvParameters) {
 	while(1) {
 		ds3231_read_date_time(&current_time);
 		struct tm *local_time = convert_to_local(&current_time);
-		setenv("TZ", "GMT+0GMT+0", 1);
-		tzset();
 		update_display(local_time->tm_hour, local_time->tm_min);
 		vTaskDelay(determine_sleep_time(local_time) / portTICK_PERIOD_MS);
 	}