Skip to content

Commit cf447a5

Browse files
gjdoddthinkyhead
authored andcommitted
🐛 Fix flowmeter calculation (MarlinFirmware#21959)
1 parent 7597b4f commit cf447a5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Marlin/src/feature/cooler.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,8 @@ class Cooler {
7878

7979
// Get the total flow (in liters per minute) since the last reading
8080
static void calc_flowrate() {
81-
//flowmeter_interrupt_disable();
82-
// const uint16_t pulses = flowpulses;
83-
//flowmeter_interrupt_enable();
84-
flowrate = flowpulses * 60.0f * (1000.0f / (FLOWMETER_INTERVAL)) * (1000.0f / (FLOWMETER_PPL));
81+
// flowrate = (litres) * (seconds) = litres per minute
82+
flowrate = (flowpulses / (float)FLOWMETER_PPL) * ((1000.0f / (float)FLOWMETER_INTERVAL) * 60.0f);
8583
flowpulses = 0;
8684
}
8785

0 commit comments

Comments
 (0)