From 37ef9a780d99e31c2e808cd11eadd12a375a7503 Mon Sep 17 00:00:00 2001 From: Fisch Date: Mon, 14 Jul 2025 18:50:26 +0200 Subject: [PATCH] fix flow check and add reset when pump is off --- include/flow.h | 9 +++++++-- src/main.cpp | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/flow.h b/include/flow.h index d5df752..cb5de9d 100644 --- a/include/flow.h +++ b/include/flow.h @@ -9,7 +9,7 @@ uint16_t flow_counter=0; //maximum counts/s measured with Eden 128 Pump was 171 void flow_setup(); void flow_loop(unsigned long loopmillis); -bool checkFlow(float minflow,unsigned long maxtime); +bool checkFlow(float minflow,unsigned long maxtime,bool reset=false); void IRAM_ATTR isr_flow(); unsigned long last_read_flow=0; @@ -58,8 +58,12 @@ void flow_loop(unsigned long loopmillis) { } -bool checkFlow(float minflow,unsigned long maxtime) { //L/min, milliseconds +bool checkFlow(float minflow,unsigned long maxtime,bool reset) { //L/min, milliseconds static unsigned long last_flow_low=0; //0=flow ok + if (reset) { + last_flow_low=0; + return true; + } if (flow