Added RAW_FRSKY_MINMAX() macro for access to the raw telemetry value and gtests for it

This commit is contained in:
Damjan Adamic
2014-07-13 14:35:15 +02:00
parent 8ce05b3284
commit 2d22c18758
3 changed files with 8 additions and 7 deletions
+3 -7
View File
@@ -196,17 +196,13 @@ void writeLogs()
#if defined(FRSKY)
#if defined(CPUARM)
f_printf(&g_oLogFile, "%d,%d,", frskyData.swr.raw, frskyData.rssi[0].raw);
f_printf(&g_oLogFile, "%d,%d,", RAW_FRSKY_MINMAX(frskyData.swr), RAW_FRSKY_MINMAX(frskyData.rssi[0]));
#else
f_printf(&g_oLogFile, "%d,%d,%d,", frskyStreaming, frskyData.rssi[0].value, frskyData.rssi[1].value);
f_printf(&g_oLogFile, "%d,%d,%d,", frskyStreaming, RAW_FRSKY_MINMAX(frskyData.rssi[0]), RAW_FRSKY_MINMAX(frskyData.rssi[1]));
#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
int16_t converted_value = applyChannelRatio(i, RAW_FRSKY_MINMAX(frskyData.analog[i]));
f_printf(&g_oLogFile, "%d.%02d,", converted_value/100, converted_value%100);
}
#endif