add days to uptime
This commit is contained in:
parent
3569fe5958
commit
f9e7048f73
4
main.c
4
main.c
@ -487,7 +487,7 @@ void main(void)
|
||||
ticks_time = rtc_get_counter_val(); // copy time from internal RTC for processing
|
||||
action = true; // action has been performed
|
||||
if ((ticks_time%(60))==0) { // one minute passed
|
||||
printf("uptime: %02lu:%02lu:%02lu\n", ticks_time/(60*60), (ticks_time%(60*60))/60, (ticks_time%60)); // display external time
|
||||
printf("uptime: %lu.%02lu:%02lu:%02lu\n", ticks_time/(60*60*24), (ticks_time/(60*60))%24, (ticks_time%(60*60))/60, (ticks_time%60)); // display external time
|
||||
}
|
||||
}
|
||||
while (pzem_meter>=LENGTH(pzem_measurements) && sdm120_meter>=LENGTH(sdm120_measurements)) { // all measurements received for all meter
|
||||
@ -603,7 +603,7 @@ void main(void)
|
||||
while (timer_get_flag(TIM(MAIN_TIMER), TIM_SR_UIF)) { // timer update event -> query measurements
|
||||
timer_clear_flag(TIM(MAIN_TIMER), TIM_SR_UIF); // clear flag
|
||||
action = true; // action has been performed
|
||||
printf("query meter measurements (%02lu:%02lu:%02lu)\n", ticks_time/(60*60), (ticks_time%(60*60))/60, (ticks_time%60));
|
||||
printf("query meter measurements (%lu.%02lu:%02lu:%02lu)\n", ticks_time/(60*60*24), (ticks_time/(60*60))%24, (ticks_time%(60*60))/60, (ticks_time%60));
|
||||
// start getting all PZEM-004T measurements from all meters
|
||||
pzem_meter = 0; // reset PZEM meter number
|
||||
pzem_measurement = 0; // reset PZEM measurement index
|
||||
|
Loading…
Reference in New Issue
Block a user