From 7a5f5809154d8130f746047d96ce258cc1a3ead9 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Tue, 12 May 2020 23:06:35 +0300 Subject: [PATCH] sns: fix unintended switch case fallthrough (#2249) --- code/espurna/sensor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/espurna/sensor.cpp b/code/espurna/sensor.cpp index df5e9593..f80f1232 100644 --- a/code/espurna/sensor.cpp +++ b/code/espurna/sensor.cpp @@ -484,17 +484,22 @@ sensor_magnitude_t::sensor_magnitude_t(unsigned char slot, unsigned char index_l switch (type) { case MAGNITUDE_ENERGY: filter = new LastFilter(); + break; case MAGNITUDE_ENERGY_DELTA: filter = new SumFilter(); + break; case MAGNITUDE_DIGITAL: filter = new MaxFilter(); + break; // For geiger counting moving average filter is the most appropriate if needed at all. case MAGNITUDE_COUNT: case MAGNITUDE_GEIGER_CPM: case MAGNITUDE_GEIGER_SIEVERT: filter = new MovingAverageFilter(); + break; default: filter = new MedianFilter(); + break; } filter->resize(_sensor_report_every);