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
+5 -1
View File
@@ -200,13 +200,17 @@ void writeLogs()
#if defined(FRSKY)
#if defined(CPUARM)
f_printf(&g_oLogFile, "%d,%d,", frskyData.swr.value, frskyData.rssi[0].value);
f_printf(&g_oLogFile, "%d,%d,", frskyData.swr.raw, frskyData.rssi[0].raw);
#else
f_printf(&g_oLogFile, "%d,%d,%d,", frskyStreaming, frskyData.rssi[0].value, frskyData.rssi[1].value);
#endif
for (uint8_t i=0; i<MAX_FRSKY_A_CHANNELS; i++) {
#if defined(CPUARM)
int16_t converted_value = applyChannelRatio(i, frskyData.analog[i].raw);
#else
int16_t converted_value = applyChannelRatio(i, frskyData.analog[i].value);
#endif
f_printf(&g_oLogFile, "%d.%02d,", converted_value/100, converted_value%100);
}
#endif