Fixes #1636
This commit is contained in:
@@ -290,8 +290,9 @@ void frskyDProcessPacket(uint8_t *packet)
|
|||||||
link_counter += 256 / FRSKY_D_AVERAGING;
|
link_counter += 256 / FRSKY_D_AVERAGING;
|
||||||
#if defined(VARIO)
|
#if defined(VARIO)
|
||||||
uint8_t varioSource = g_model.frsky.varioSource - VARIO_SOURCE_A1;
|
uint8_t varioSource = g_model.frsky.varioSource - VARIO_SOURCE_A1;
|
||||||
if (varioSource < 2)
|
if (varioSource < 2) {
|
||||||
frskyData.hub.varioSpeed = applyChannelRatio(varioSource, frskyData.analog[varioSource].value);
|
frskyData.hub.varioSpeed = applyChannelRatio(varioSource, frskyData.analog[varioSource].value);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -300,12 +301,14 @@ void frskyDProcessPacket(uint8_t *packet)
|
|||||||
uint8_t numBytes = 3 + (packet[1] & 0x07); // sanitize in case of data corruption leading to buffer overflow
|
uint8_t numBytes = 3 + (packet[1] & 0x07); // sanitize in case of data corruption leading to buffer overflow
|
||||||
for (uint8_t i=3; i<numBytes; i++) {
|
for (uint8_t i=3; i<numBytes; i++) {
|
||||||
#if defined(FRSKY_HUB)
|
#if defined(FRSKY_HUB)
|
||||||
if (IS_USR_PROTO_FRSKY_HUB())
|
if (IS_USR_PROTO_FRSKY_HUB()) {
|
||||||
parseTelemHubByte(packet[i]);
|
parseTelemHubByte(packet[i]);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if defined(WS_HOW_HIGH)
|
#if defined(WS_HOW_HIGH)
|
||||||
if (IS_USR_PROTO_WS_HOW_HIGH())
|
if (IS_USR_PROTO_WS_HOW_HIGH()) {
|
||||||
parseTelemWSHowHighByte(packet[i]);
|
parseTelemWSHowHighByte(packet[i]);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ void frskySportProcessPacket(uint8_t *packet)
|
|||||||
if (appId == SWR_ID) {
|
if (appId == SWR_ID) {
|
||||||
frskyData.swr.set(SPORT_DATA_U8(packet));
|
frskyData.swr.set(SPORT_DATA_U8(packet));
|
||||||
}
|
}
|
||||||
else if (appId == ADC1_ID || appId == ADC2_ID) {
|
else if (frskyData.rssi[0].value > 0) {
|
||||||
|
if (appId == ADC1_ID || appId == ADC2_ID) {
|
||||||
// A1/A2 of DxR receivers
|
// A1/A2 of DxR receivers
|
||||||
uint8_t idx = appId - ADC1_ID;
|
uint8_t idx = appId - ADC1_ID;
|
||||||
frskyData.analog[idx].set(SPORT_DATA_U8(packet), g_model.frsky.channels[idx].type);
|
frskyData.analog[idx].set(SPORT_DATA_U8(packet), g_model.frsky.channels[idx].type);
|
||||||
@@ -488,6 +489,7 @@ void frskySportProcessPacket(uint8_t *packet)
|
|||||||
frskySetCellVoltage(battnumber+1, (frskyCellVoltage_t) ((data & 0xFFF00000) >> 20) / 5);
|
frskySetCellVoltage(battnumber+1, (frskyCellVoltage_t) ((data & 0xFFF00000) >> 20) / 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user