diff options
Diffstat (limited to 'avr/main.c')
-rw-r--r-- | avr/main.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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")); |