- drop ADF pipeline stuff related to playback, this introduced too much non deterministic delay - add fast median calculation component - increase LWIP buffers
29 lines
603 B
Plaintext
29 lines
603 B
Plaintext
#include "MedianFilter.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
|
|
#define NUM_ELEMENTS 7
|
|
|
|
static sMedianFilter_t medianFilter;
|
|
static sMedianNode_t medianBuffer[NUM_ELEMENTS];
|
|
|
|
int median_example(void)
|
|
{
|
|
medianFilter.numNodes = NUM_ELEMENTS;
|
|
medianFilter.medianBuffer = medianBuffer;
|
|
|
|
MEDIANFILTER_Init(&medianFilter);
|
|
|
|
while(1)
|
|
{
|
|
int newValue = rand() % 10;
|
|
int medianValue = MEDIANFILTER_Insert(&medianFilter, newValue);
|
|
printf("New value: %d \tMedian value: %d\r\n", newValue, medianValue);
|
|
sleep(1);
|
|
}
|
|
|
|
return 0;
|
|
}
|