summaryrefslogtreecommitdiff
path: root/avr/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'avr/main.c')
-rw-r--r--avr/main.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/avr/main.c b/avr/main.c
index 7e832bf..8acf265 100644
--- a/avr/main.c
+++ b/avr/main.c
@@ -20,6 +20,8 @@
#include "z180-serv.h"
#include "spi.h"
#include "gpio.h"
+#include "time.h"
+#include "rtc.h"
static uint8_t mcusr;
@@ -132,6 +134,16 @@ int reset_reason_is_power_on(void)
return (mcusr & _BV(PORF)) != 0;
}
+static
+void setup_system_time(void)
+{
+ struct tm rtc_time;
+
+ rtc_get(&rtc_time);
+ rtc_time.tm_isdst = 0;
+ set_system_time(mk_gmtime(&rtc_time) );
+}
+
/*--------------------------------------------------------------------------*/
/* Stored value of bootdelay, used by autoboot_command() */
@@ -252,6 +264,7 @@ int main(void)
#else
i2c_init(CONFIG_SYS_I2C_CLOCK);
#endif
+ setup_system_time();
printf_P(PSTR("\nATMEGA1281+Z8S180 Stamp Monitor\n\n"));