From 968293e599bcb29a9312a1cb402d55cc58b9475f Mon Sep 17 00:00:00 2001 From: pascallanger Date: Thu, 22 Feb 2024 17:29:00 +0100 Subject: [PATCH] Remove Hisky/HK310 when MULTI_AIR --- Multiprotocol/Hisky_nrf24l01.ino | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Multiprotocol/Hisky_nrf24l01.ino b/Multiprotocol/Hisky_nrf24l01.ino index 17e25ea58..bc16c9af9 100644 --- a/Multiprotocol/Hisky_nrf24l01.ino +++ b/Multiprotocol/Hisky_nrf24l01.ino @@ -66,8 +66,10 @@ static void __attribute__((unused)) HISKY_RF_init() NRF24L01_WriteRegisterMulti(NRF24L01_0A_RX_ADDR_P0, rx_tx_addr, 5); NRF24L01_WriteRegisterMulti(NRF24L01_10_TX_ADDR, rx_tx_addr, 5); NRF24L01_WriteReg(NRF24L01_11_RX_PW_P0, 10); // payload size = 10 + #ifndef MULTI_AIR if(sub_protocol==HK310) NRF24L01_SetBitrate(NRF24L01_BR_250K); // 250Kbps + #endif } // HiSky channel sequence: AILE ELEV THRO RUDD GEAR PITCH, channel data value is from 0 to 1000 @@ -92,6 +94,13 @@ static void __attribute__((unused)) HISKY_build_ch_data() uint16_t HISKY_callback() { phase++; + #ifdef MULTI_AIR + if(sub_protocol==HK310) + { + SUB_PROTO_INVALID; + return 10000; + } + #else if(sub_protocol==HK310) switch(phase) { @@ -132,6 +141,7 @@ uint16_t HISKY_callback() phase=8; break; } + #endif switch(phase) { case 1: @@ -195,6 +205,7 @@ uint16_t HISKY_callback() static void __attribute__((unused)) HISKY_initialize_tx_id() { //Generate frequency hopping table + #ifndef MULTI_AIR if(sub_protocol==HK310) { // for HiSky surface protocol, the transmitter always generates hop channels in sequential order. @@ -204,10 +215,11 @@ static void __attribute__((unused)) HISKY_initialize_tx_id() hopping_frequency[i]=hopping_frequency_no++; // Sequential order hop channels... } else - calc_fh_channels(HISKY_FREQUENCE_NUM); + #endif // HiSky air protocol uses TX id as an address for nRF24L01, and uses frequency hopping sequence // which does not depend on this id and is passed explicitly in binding sequence. So we are free // to generate this sequence as we wish. It should be in the range [02..77] + calc_fh_channels(HISKY_FREQUENCE_NUM); } void HISKY_init()