BluetoothDispatcher was added & reformatting

This commit is contained in:
2024-01-05 20:38:10 +07:00
parent 02f53416ab
commit 21dbd883f7
15 changed files with 522 additions and 647 deletions

19
Filters/median3.hpp Normal file
View File

@@ -0,0 +1,19 @@
// быстрый медианный фильтр 3-го порядка
#ifndef _GMedian3_h
#define _GMedian3_h
template < typename TYPE >
class GMedian3 {
public:
TYPE filtered(TYPE value) { // возвращает фильтрованное значение
buf[_counter] = value;
if (++_counter > 2) _counter = 0;
return (max(buf[0], buf[1]) == max(buf[1], buf[2])) ? max(buf[0], buf[2]) : max(buf[1], min(buf[0], buf[2]));
}
private:
TYPE buf[3];
uint8_t _counter = 0;
};
#endif