You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
429 B
C++

#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;
}