Fix AFHDS2A receiver packet filter (#276)

* Add skeleton for AFHDS2A receiver protocol

* Bind & data Ok

* Send channels to TX via telemetry

* Add RSSI

* Fix AVR compilation

* Fix channel number

* Fix packet type check
This commit is contained in:
goebish 2019-10-02 09:04:13 +02:00 committed by pascallanger
parent f3d2ab61e4
commit 032e0641a5

View File

@ -167,7 +167,7 @@ uint16_t AFHDS2A_Rx_callback()
if (AFHDS2A_Rx_data_ready()) {
A7105_ReadData(AFHDS2A_RX_TXPACKET_SIZE);
if (memcmp(&packet[1], rx_id, 4) == 0 && memcmp(&packet[5], rx_tx_addr, 4) == 0) {
if (packet[0] = 0x58 && packet[37] == 0x00 && telemetry_link == 0) { // standard packet, send channels to TX
if (packet[0] == 0x58 && packet[37] == 0x00 && telemetry_link == 0) { // standard packet, send channels to TX
int rssi = min(A7105_ReadReg(A7105_1D_RSSI_THOLD),160);
RX_RSSI = map(rssi, 160, 8, 0, 100);
AFHDS2A_Rx_build_telemetry_packet();