[FrSky] Support of old FAS prototypes (different resistors)
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "../opentx.h"
|
||||
#include "opentx.h"
|
||||
|
||||
#if (defined(FRSKY_HUB) || defined(WS_HOW_HIGH))
|
||||
void checkMinMaxAltitude()
|
||||
@@ -130,10 +130,10 @@ void parseTelemHubByte(uint8_t byte)
|
||||
break;
|
||||
|
||||
case offsetof(FrskyTelemetryData, volts_ap):
|
||||
#if defined(FAS_BSS)
|
||||
#if defined(FAS_PROTOTYPE)
|
||||
telemetryData.hub.vfas = (telemetryData.hub.volts_bp * 10 + telemetryData.hub.volts_ap);
|
||||
#else
|
||||
telemetryData.hub.vfas = ((telemetryData.hub.volts_bp * 100 + telemetryData.hub.volts_ap * 10) * 21) / 110;
|
||||
telemetryData.hub.vfas = ((telemetryData.hub.volts_bp * 10 + telemetryData.hub.volts_ap) * 21) / 11;
|
||||
#endif
|
||||
/* TODO later if (!telemetryData.hub.minVfas || telemetryData.hub.minVfas > telemetryData.hub.vfas)
|
||||
telemetryData.hub.minVfas = telemetryData.hub.vfas; */
|
||||
|
||||
@@ -207,7 +207,11 @@ void processHubPacket(uint8_t id, int16_t value)
|
||||
}
|
||||
else if (id == VOLTS_AP_ID) {
|
||||
if (lastId == VOLTS_BP_ID) {
|
||||
#if defined(FAS_PROTOTYPE)
|
||||
data = lastBPValue * 100 + value * 10;
|
||||
#else
|
||||
data = ((lastBPValue * 100 + value * 10) * 210) / 110;
|
||||
#endif
|
||||
unit = UNIT_VOLTS;
|
||||
precision = 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user