Filter: fixed example build

This commit is contained in:
Andrew Tridgell 2012-11-24 21:08:48 +11:00
parent e7ad044019
commit 5a0632340c
2 changed files with 5 additions and 1 deletions

View File

@ -37,6 +37,10 @@ public:
return FILTER_SIZE;
};
virtual T get_sample(uint8_t i) {
return samples[i];
}
protected:
T samples[FILTER_SIZE]; // buffer of samples
uint8_t sample_index; // pointer to the next empty slot in the buffer

View File

@ -30,7 +30,7 @@ void printFilter(FilterWithBufferInt16_Size5& filter)
{
for(uint8_t i=0; i < filter.get_filter_size(); i++)
{
Serial.printf("%d ",(int)filter.samples[i]);
Serial.printf("%d ",(int)filter.get_sample(i));
}
Serial.println();
}