Create global 'time' variable which holds RTC value

This commit is contained in:
2020-11-19 22:03:35 +01:00
parent ca61a84220
commit 29c593c2a4
9 changed files with 46 additions and 46 deletions

View File

@@ -13,7 +13,6 @@
#define I2C_BITRATE 100000UL // 100kHz
void update_time(void);
int main()
{
@@ -35,23 +34,6 @@ int main()
keyboard_handle_input();
uart_handle_event(uart_buf);
update_time();
if(rtc_handle_timer()) nightm_handle();
}
}
void update_time(void)
{
if(!(GIFR & (1<<INTF0)))
{
struct TIME_HMS curr_time = rtc_read_time();
led_display = curr_time;
nightm_handle(&curr_time);
}
GIFR |= 1<<INTF0;
}
ISR(INT0_vect)
{
}