fix RTC counter and add blinking
This commit is contained in:
parent
c6c74aaa1b
commit
efcf735395
3
main.c
3
main.c
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue