Browse Source

sns: fix unintended switch case fallthrough (#2249)

mcspr-patch-1
Max Prokhorov 4 years ago
committed by GitHub
parent
commit
7a5f580915
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      code/espurna/sensor.cpp

+ 5
- 0
code/espurna/sensor.cpp View File

@ -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);


Loading…
Cancel
Save