Reduced the size of averaging buffer and introduced a raw (unfiltered) value. Averaged value is same as before, but one byte saved per class instance. Unfiltered value is used for writing into telemetry log.

This commit is contained in:
Damjan Adamic
2014-06-30 21:12:01 +02:00
parent d38c02f847
commit 3f39352d95
3 changed files with 29 additions and 8 deletions
+4 -3
View File
@@ -70,12 +70,13 @@ extern uint8_t telemetryState;
#endif
#if defined(CPUARM)
#define TELEMETRY_AVERAGE_COUNT 4
#define TELEMETRY_AVERAGE_COUNT 2 //we actually average two more readings!
class FrskyValueWithMin {
public:
uint8_t value;
uint8_t min;
uint8_t value; //fitered value (average of last TELEMETRY_AVERAGE_COUNT+2 values)
uint8_t min;
uint8_t values[TELEMETRY_AVERAGE_COUNT];
uint8_t raw; //raw value (unfiltered)
void set(uint8_t value);
};
#else