From 0e40f64c6b95467254533ac9fd92f4552892c236 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Sun, 10 Nov 2019 18:55:03 +0100 Subject: [PATCH] Enable HoTT RX config menu Use OpenTX lua script --- Multiprotocol/HOTT_cc2500.ino | 18 ++++++++++++++++++ Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/Multiprotocol.ino | 14 ++++++++++++++ Protocols_Details.md | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Multiprotocol/HOTT_cc2500.ino b/Multiprotocol/HOTT_cc2500.ino index e3f3cea..d82f410 100644 --- a/Multiprotocol/HOTT_cc2500.ino +++ b/Multiprotocol/HOTT_cc2500.ino @@ -211,6 +211,20 @@ static void __attribute__((unused)) HOTT_data_packet() packet[i+1] = val>>8; } + #ifdef HOTT_FW_TELEMETRY + if(HoTT_SerialRX && HoTT_SerialRX_val >= 0xD7 && HoTT_SerialRX_val <= 0xDF) + { + packet[28] = HoTT_SerialRX_val; // 0xDX->config menu + packet[29] = 0x01; // 0x01->config menu + HoTT_SerialRX_val = 0xDF; // no touch pressed + } + else + { + packet[28] = 0x8C; // unknown 0x80 when bind starts then when RX replies start normal, 0x89/8A/8B/8C/8D/8E during normal packets, 0x0F->config menu + packet[29] = 0x02; // unknown 0x02 when bind starts then when RX replies cycle in sequence 0x1A/22/2A/0A/12, 0x02 during normal packets, 0x01->config menu, 0x0A->no more RX telemetry + } + #endif + CC2500_SetTxRxMode(TX_EN); CC2500_SetPower(); CC2500_WriteReg(CC2500_06_PKTLEN, 0x32); @@ -354,6 +368,10 @@ uint16_t initHOTT() HOTT_init(); HOTT_rf_init(); packet_count=0; + #ifdef HOTT_FW_TELEMETRY + HoTT_SerialRX_val=0; + HoTT_SerialRX=false; + #endif phase = HOTT_START; return 10000; } diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 02964db..15a1152 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 0 -#define VERSION_PATCH_LEVEL 42 +#define VERSION_PATCH_LEVEL 43 //****************** // Protocols diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index f517db9..789292b 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -243,6 +243,10 @@ uint8_t packet_in[TELEMETRY_BUFFER_SIZE];//telemetry receiving packets extern const mm_protocol_definition multi_protocols[]; uint8_t multi_protocols_index=0xFF; #endif + #ifdef HOTT_FW_TELEMETRY + uint8_t HoTT_SerialRX_val=0; + bool HoTT_SerialRX=false; + #endif #endif // TELEMETRY // Callback @@ -1682,6 +1686,9 @@ void update_serial_data() Channel_data[i]=temp; //value range 0..2047, 0=-125%, 2047=+125% } + #ifdef HOTT_FW_TELEMETRY + HoTT_SerialRX=false; + #endif if(rx_len>27) { // Data available for the current protocol #ifdef SPORT_SEND @@ -1720,6 +1727,13 @@ void update_serial_data() } } #endif //SPORT_SEND + #ifdef HOTT_FW_TELEMETRY + if(protocol==PROTO_HOTT && rx_len==28) + {//Protocol waiting for 1 byte + HoTT_SerialRX_val=rx_ok_buff[27]; + HoTT_SerialRX=true; + } + #endif } RX_DONOTUPDATE_off; diff --git a/Protocols_Details.md b/Protocols_Details.md index a008e4f..91c1bf0 100644 --- a/Protocols_Details.md +++ b/Protocols_Details.md @@ -417,7 +417,7 @@ Extended limits and failsafe supported **Failsafe MUST be configured once with the desired channel values (hold or position) while the RX is up (wait 10+sec for the RX to learn the config) and then failsafe MUST be set to RX/Receiver otherwise the servos will jitter!!!** -**The RX features must be configured first on a Graupner radio before binding it with Multi (RX config not implemented).** +The RX features configuration are done using the OpenTX script "Graupner HoTT.lua" . Option for this protocol corresponds to fine frequency tuning. This value is different for each Module and **must** be accurate otherwise the link will not be stable. Check the [Frequency Tuning page](/docs/Frequency_Tuning.md) to determine it.