Skip to content

Commit

Permalink
🐛 Fix flowmeter calculation (MarlinFirmware#21959)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjdodd authored and thinkyhead committed May 24, 2021
1 parent 7597b4f commit cf447a5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Marlin/src/feature/cooler.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ class Cooler {

// Get the total flow (in liters per minute) since the last reading
static void calc_flowrate() {
//flowmeter_interrupt_disable();
// const uint16_t pulses = flowpulses;
//flowmeter_interrupt_enable();
flowrate = flowpulses * 60.0f * (1000.0f / (FLOWMETER_INTERVAL)) * (1000.0f / (FLOWMETER_PPL));
// flowrate = (litres) * (seconds) = litres per minute
flowrate = (flowpulses / (float)FLOWMETER_PPL) * ((1000.0f / (float)FLOWMETER_INTERVAL) * 60.0f);
flowpulses = 0;
}

Expand Down

0 comments on commit cf447a5

Please sign in to comment.