fix RTC counter and add blinking

This commit is contained in:
King Kévin 2016-08-20 23:32:08 +02:00
parent c6c74aaa1b
commit efcf735395
1 changed files with 2 additions and 1 deletions

3
main.c
View File

@ -213,7 +213,7 @@ void main(void)
rtc_internal_tick_flag = false; // reset flag
ticks_time = rtc_get_counter_val(); // copy time from internal RTC for processing
action = true; // action has been performed
if ((ticks_time%(24*60*60))==0) { // one day passed
if (ticks_time!=0 && (ticks_time%(24*60*60))==0) { // one day passed
rtc_set_counter_val(0); // reset counter
}
if ((ticks_time%(60))==0) { // one minute passed
@ -234,4 +234,5 @@ void rtc_isr(void)
{
rtc_clear_flag(RTC_SEC); // clear flag
rtc_internal_tick_flag = true; // notify to show new time
led_toggle(); // blink every second to show the firmware is running
}