Fix AFHDS2A_RX

This commit is contained in:
pascallanger 2019-10-02 21:24:50 +02:00
parent 49a1ecea00
commit bf61295b76
3 changed files with 8 additions and 8 deletions

View File

@ -36,10 +36,10 @@ static void __attribute__((unused)) AFHDS2A_Rx_build_telemetry_packet()
uint8_t bitsavailable = 0;
uint8_t idx = 0;
pkt[idx++] = RX_LQI; // 0 - 130
pkt[idx++] = RX_RSSI;
pkt[idx++] = 0; // start channel
pkt[idx++] = 14; // number of channels in packet
packet_in[idx++] = RX_LQI; // 0 - 130
packet_in[idx++] = RX_RSSI;
packet_in[idx++] = 0; // start channel
packet_in[idx++] = 14; // number of channels in packet
// pack channels
for (uint8_t i = 0; i < 14; i++) {
uint16_t val = packet[9+i*2] | (packet[10+i*2] << 8);
@ -52,7 +52,7 @@ static void __attribute__((unused)) AFHDS2A_Rx_build_telemetry_packet()
bits |= val << bitsavailable;
bitsavailable += 11;
while (bitsavailable >= 8) {
pkt[idx++] = bits & 0xff;
packet_in[idx++] = bits & 0xff;
bits >>= 8;
bitsavailable -= 8;
}
@ -182,7 +182,7 @@ uint16_t AFHDS2A_Rx_callback()
// packets per second
if (millis() - pps_timer >= 1000) {
pps_timer = millis();
debugln("%ld pps", pps_counter);
debugln("%d pps", pps_counter);
RX_LQI = pps_counter / 2;
pps_counter = 0;
}

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 4
#define VERSION_PATCH_LEVEL 5
//******************
// Protocols

View File

@ -167,7 +167,7 @@ static void multi_send_status()
#if defined (FRSKYX_RX_TELEMETRY) || defined (AFHDS2A_RX_TELEMETRY)
void receiver_channels_frame()
{
uint16_t len = pkt[3] * 11; // 11 bit per channel
uint16_t len = packet_in[3] * 11; // 11 bit per channel
if (len % 8 == 0)
len = 4 + (len / 8);
else