Dynamic graph recorder timer

This commit is contained in:
Carsten Schmiemann 2022-11-20 02:47:35 +01:00
parent 39d9ffc3a1
commit 49cfd69b17
1 changed files with 5 additions and 7 deletions

View File

@ -725,26 +725,24 @@ void loop() {
//Graph recorder - 1h
if (display_conf_graph_present)
{
if(millis() - lastGraphRecord_1h >= 30000) //temporarily set to half minute
if(millis() - lastGraphRecord_1h >= ((1 *60*60*1000 ) / display_graph_buffersize)) //temporarily set to half minute
{
display_graph_ringbuffer_add(display_graph_ringbuffer_load_1h, grid_p);
if (display_conf_dc_pvcharger_present)
{
display_graph_ringbuffer_add(display_graph_ringbuffer_pv_1h, pv_w);
}
lastGraphRecord_1h += 30000;
Serial.println("Graph ringbuffer 1h - new value added");
lastGraphRecord_1h += (1 *60*60*1000 ) / display_graph_buffersize;
}
/*if(millis() - lastGraphRecord_24h >= 864000)
if(millis() - lastGraphRecord_24h >= ((24 *60*60*1000 ) / display_graph_buffersize))
{
display_graph_ringbuffer_add(display_graph_ringbuffer_load_24h, grid_p);
if (display_conf_dc_pvcharger_present)
{
display_graph_ringbuffer_add(display_graph_ringbuffer_pv_24h, pv_w);
}
lastGraphRecord_24h += 864000;
Serial.println("Graph ringbuffer 24h - new value added");
}*/
lastGraphRecord_24h += (24 *60*60*1000 ) / display_graph_buffersize;
}
}
//Rotate screen if BUTTON_ROTATION is pressed