aboutsummaryrefslogtreecommitdiffstats
path: root/filter/test.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2020-08-20 17:06:47 -0400
committerClyne Sullivan <clyne@bitgloo.com>2020-08-20 17:06:47 -0400
commit989f4038c6d2a3e5bbee04fa25df181810af621e (patch)
tree73987829cac7e15ab8763211bcef582ec885f3a2 /filter/test.cpp
parent2ceb20f4d48a8f163528f86fda484e977438bc80 (diff)
parent29e4b4cf091dd47c9f435ef1d315a1609b83fb19 (diff)
merge elf loading and adc streaming
Diffstat (limited to 'filter/test.cpp')
-rw-r--r--filter/test.cpp15
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;
+}
+