diff --git a/src/main.cpp b/src/main.cpp index 5686d81..591b155 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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