mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-05 00:08:13 +00:00
Fix AFHDS2A_RX
This commit is contained in:
parent
49a1ecea00
commit
bf61295b76
@ -36,10 +36,10 @@ static void __attribute__((unused)) AFHDS2A_Rx_build_telemetry_packet()
|
|||||||
uint8_t bitsavailable = 0;
|
uint8_t bitsavailable = 0;
|
||||||
uint8_t idx = 0;
|
uint8_t idx = 0;
|
||||||
|
|
||||||
pkt[idx++] = RX_LQI; // 0 - 130
|
packet_in[idx++] = RX_LQI; // 0 - 130
|
||||||
pkt[idx++] = RX_RSSI;
|
packet_in[idx++] = RX_RSSI;
|
||||||
pkt[idx++] = 0; // start channel
|
packet_in[idx++] = 0; // start channel
|
||||||
pkt[idx++] = 14; // number of channels in packet
|
packet_in[idx++] = 14; // number of channels in packet
|
||||||
// pack channels
|
// pack channels
|
||||||
for (uint8_t i = 0; i < 14; i++) {
|
for (uint8_t i = 0; i < 14; i++) {
|
||||||
uint16_t val = packet[9+i*2] | (packet[10+i*2] << 8);
|
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;
|
bits |= val << bitsavailable;
|
||||||
bitsavailable += 11;
|
bitsavailable += 11;
|
||||||
while (bitsavailable >= 8) {
|
while (bitsavailable >= 8) {
|
||||||
pkt[idx++] = bits & 0xff;
|
packet_in[idx++] = bits & 0xff;
|
||||||
bits >>= 8;
|
bits >>= 8;
|
||||||
bitsavailable -= 8;
|
bitsavailable -= 8;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ uint16_t AFHDS2A_Rx_callback()
|
|||||||
// packets per second
|
// packets per second
|
||||||
if (millis() - pps_timer >= 1000) {
|
if (millis() - pps_timer >= 1000) {
|
||||||
pps_timer = millis();
|
pps_timer = millis();
|
||||||
debugln("%ld pps", pps_counter);
|
debugln("%d pps", pps_counter);
|
||||||
RX_LQI = pps_counter / 2;
|
RX_LQI = pps_counter / 2;
|
||||||
pps_counter = 0;
|
pps_counter = 0;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_REVISION 0
|
#define VERSION_REVISION 0
|
||||||
#define VERSION_PATCH_LEVEL 4
|
#define VERSION_PATCH_LEVEL 5
|
||||||
|
|
||||||
//******************
|
//******************
|
||||||
// Protocols
|
// Protocols
|
||||||
|
@ -167,7 +167,7 @@ static void multi_send_status()
|
|||||||
#if defined (FRSKYX_RX_TELEMETRY) || defined (AFHDS2A_RX_TELEMETRY)
|
#if defined (FRSKYX_RX_TELEMETRY) || defined (AFHDS2A_RX_TELEMETRY)
|
||||||
void receiver_channels_frame()
|
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)
|
if (len % 8 == 0)
|
||||||
len = 4 + (len / 8);
|
len = 4 + (len / 8);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user