1
0
forked from me/IronOS

Format headers

This commit is contained in:
Ben V. Brown
2021-01-17 10:53:49 +11:00
parent f786901da0
commit bf5055edaa
173 changed files with 42831 additions and 47623 deletions

View File

@@ -9,16 +9,11 @@
#define INC_EXPMOVINGAVERAGE_H_
// max size = 127
template<class T, uint8_t weighting>
struct expMovingAverage {
int32_t sum;
void update(T const val) {
sum = ((val * weighting) + (sum * (256 - weighting))) / 256;
}
template <class T, uint8_t weighting> struct expMovingAverage {
int32_t sum;
void update(T const val) { sum = ((val * weighting) + (sum * (256 - weighting))) / 256; }
T average() const {
return sum;
}
T average() const { return sum; }
};
#endif /* INC_EXPMOVINGAVERAGE_H_ */