diff options
Diffstat (limited to 'filter/test.cpp')
-rw-r--r-- | filter/test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/filter/test.cpp b/filter/test.cpp new file mode 100644 index 0000000..0953539 --- /dev/null +++ b/filter/test.cpp @@ -0,0 +1,15 @@ +#include <cstdint> + +using adcsample_t = uint16_t; +__attribute__((section(".process_data"))) +void process_data(adcsample_t *samples, unsigned int size); + +//////////////////////////////////////////////////////////////////////////////// + +void process_data(adcsample_t *samples, unsigned int size) +{ + size--; + for (unsigned int i = 0; i < size; i++) + samples[i] = samples[i] * 80 / 100 + samples[i + 1] * 20 / 100; +} + |