1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-24 12:35:51 +00:00

🐛 Fix flowmeter calculation (#21959)

This commit is contained in:
gjdodd 2021-05-24 07:54:10 +01:00 committed by GitHub
parent 84fd0eff17
commit 9398c43112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,10 +78,8 @@ public:
// 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;
}