mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-11-25 13:29:40 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bd50f4c8c | ||
|
|
4c2ddcbe48 | ||
|
|
d7f9ef6967 | ||
|
|
bfc8c2f9fd | ||
|
|
ce6243d6e3 | ||
|
|
80f9ff4163 | ||
|
|
d9f8a3989a | ||
|
|
416f7d5c19 | ||
|
|
eb24dd5549 | ||
|
|
ba19592973 | ||
|
|
98d8d7fb5f | ||
|
|
ad0947b0b7 |
37
.github/workflows/main.yml
vendored
37
.github/workflows/main.yml
vendored
@@ -40,14 +40,14 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
board: [
|
||||
"multi4in1:avr:multiatmega328p:bootloader=none",
|
||||
"multi4in1:avr:multiatmega328p:bootloader=optiboot",
|
||||
"multi4in1:avr:multixmega32d4",
|
||||
"multi4in1:STM32F1:multi5in1t18int",
|
||||
"multi4in1:STM32F1:multistm32f103cb:debug_option=none",
|
||||
"multi4in1:STM32F1:multistm32f103cb:debug_option=native",
|
||||
"multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi",
|
||||
"multi4in1:STM32F1:multistm32f103c8:debug_option=none"
|
||||
"multi4in1-devel:avr:multiatmega328p:bootloader=none",
|
||||
"multi4in1-devel:avr:multiatmega328p:bootloader=optiboot",
|
||||
"multi4in1-devel:avr:multixmega32d4",
|
||||
"multi4in1-devel:STM32F1:multi5in1t18int",
|
||||
"multi4in1-devel:STM32F1:multistm32f103cb:debug_option=none",
|
||||
"multi4in1-devel:STM32F1:multistm32f103cb:debug_option=native",
|
||||
"multi4in1-devel:STM32F1:multistm32f103cb:debug_option=ftdi",
|
||||
"multi4in1-devel:STM32F1:multistm32f103c8:debug_option=none"
|
||||
]
|
||||
|
||||
# Set the environment variables
|
||||
@@ -67,15 +67,22 @@ jobs:
|
||||
echo "Event action: ${{ github.event.action }}"
|
||||
echo "Tag name: ${{ github.event.release.tag_name }}"
|
||||
|
||||
arduino-cli config init --additional-urls https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json
|
||||
arduino-cli config init --additional-urls https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/master/package_multi_4in1_board_index.json,https://raw.githubusercontent.com/pascallanger/DIY-Multiprotocol-TX-Module-Boards/devel/source/package_multi_4in1_board_devel_index.json
|
||||
arduino-cli core update-index
|
||||
|
||||
if [[ "$BOARD" =~ "multi4in1:avr:" ]]; then
|
||||
if [[ "$BOARD" =~ ":avr:" ]]; then
|
||||
arduino-cli core install arduino:avr;
|
||||
fi
|
||||
|
||||
if [[ "$BOARD" =~ "multi4in1-devel:avr" ]]; then
|
||||
arduino-cli core install multi4in1-devel:avr
|
||||
elif [[ "$BOARD" =~ "multi4in1:avr" ]]; then
|
||||
arduino-cli core install multi4in1:avr
|
||||
fi
|
||||
|
||||
if [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
|
||||
if [[ "$BOARD" =~ "multi4in1-devel:STM32F1:" ]]; then
|
||||
arduino-cli core install multi4in1-devel:STM32F1
|
||||
elif [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
|
||||
arduino-cli core install multi4in1:STM32F1
|
||||
fi
|
||||
|
||||
@@ -109,18 +116,18 @@ jobs:
|
||||
echo "ALL_RFMODULES=$(echo $ALL_RFMODULES)" >> $GITHUB_ENV
|
||||
|
||||
# Disable CHECK_FOR_BOOTLOADER when not needed
|
||||
if [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
|
||||
if [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=none" ]]; then
|
||||
opt_disable CHECK_FOR_BOOTLOADER;
|
||||
fi
|
||||
|
||||
# Trim the build down for the Atmega328p board
|
||||
if [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:" ]]; then
|
||||
if [[ "$BOARD" =~ ":avr:multiatmega328p:" ]]; then
|
||||
opt_disable $ALL_PROTOCOLS
|
||||
opt_enable FRSKYX_CC2500_INO AFHDS2A_A7105_INO MJXQ_NRF24L01_INO DSM_CYRF6936_INO;
|
||||
fi
|
||||
|
||||
# Trim the enabled protocols down for the STM32F103CB board with debugging or the STM32F103C8 board in general
|
||||
if [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi" ]] || [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103cb:debug_option=native" ]] || [[ "$BOARD" =~ "multi4in1:STM32F1:multistm32f103c8" ]]; then
|
||||
if [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=ftdi" ]] || [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=native" ]] || [[ "$BOARD" =~ ":STM32F1:multistm32f103c8" ]]; then
|
||||
opt_disable $ALL_PROTOCOLS;
|
||||
opt_enable FRSKYX_CC2500_INO AFHDS2A_A7105_INO MJXQ_NRF24L01_INO DSM_CYRF6936_INO;
|
||||
fi
|
||||
@@ -133,7 +140,7 @@ jobs:
|
||||
- name: Build default configuration
|
||||
run: |
|
||||
# Skip the default build for boards where it's too large now
|
||||
if [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103cb:debug_option=none" ]] || [[ "$BOARD" == "multi4in1:STM32F1:multi5in1t18int" ]]; then
|
||||
if [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=none" ]] || [[ "$BOARD" =~ ":STM32F1:multi5in1t18int" ]]; then
|
||||
printf "Not testing default build for $BOARD.";
|
||||
else
|
||||
source ./buildroot/bin/buildFunctions;
|
||||
|
||||
@@ -552,8 +552,8 @@ local function DSM_Init()
|
||||
RxName[0x001E]="AR631"
|
||||
|
||||
--Text to be displayed -> need to use a file instead?
|
||||
Text[0x0001]="On"
|
||||
Text[0x0002]="Off"
|
||||
Text[0x0001]="Off"
|
||||
Text[0x0002]="On"
|
||||
Text[0x0003]="Inh"
|
||||
Text[0x0004]="Act"
|
||||
Text[0x000C]="Inhibit?" --?
|
||||
|
||||
@@ -86,7 +86,8 @@
|
||||
55,1,FrSkyRX,CloneTX,0
|
||||
55,2,FrSkyRX,EraseTX,0
|
||||
55,3,FrSkyRX,CPPM,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
|
||||
58,0,FX816,Std,1
|
||||
58,0,FX,816,1
|
||||
58,1,FX,620,1
|
||||
20,0,FY326,FY326,1,Flip,RTH,HLess,Expert,Calib
|
||||
20,1,FY326,FY319,1,Flip,RTH,HLess,Expert,Calib
|
||||
23,0,FY326,FY326,1,Flip,RTH,HLess,Expert
|
||||
@@ -171,6 +172,7 @@
|
||||
5,1,V2x2,JXD506,1,Flip,Light,Pict,Video,HLess,StaSto,Emerg,Cam_UD
|
||||
48,0,V761,3CH,0,Gyro,Calib,Flip,RtnAct,Rtn
|
||||
48,1,V761,4CH,0,Gyro,Calib,Flip,RtnAct,Rtn
|
||||
48,2,V761,TOPRC,0,Gyro,Calib,Flip,RtnAct,Rtn
|
||||
46,0,V911s,V911s,1,Calib,Rate
|
||||
46,1,V911s,E119,1,Calib,Rate,6G_3D
|
||||
22,0,WFLY,WFR0xS,0,CH5,CH6,CH7,CH8,CH9
|
||||
@@ -203,3 +205,4 @@
|
||||
90,1,MouldKg,Digit,0
|
||||
91,0,Xerall,Tank,0,FlTa,TakLan,Rate,HLess,Photo,Video,TrimR,TrimE,TrimA
|
||||
92,0,MT99xx2,PA18,0,MODE,FLIP,RTH
|
||||
93,0,Kyosho2,KT-17,0
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
This project is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Multiprotocol is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// Compatible with FEI XIONG P38 plane.
|
||||
|
||||
#if defined(FX816_NRF24L01_INO)
|
||||
|
||||
#include "iface_xn297.h"
|
||||
|
||||
#define FX816_INITIAL_WAIT 500
|
||||
#define FX816_PACKET_PERIOD 10000
|
||||
#define FX816_RF_BIND_CHANNEL 0x28 //40
|
||||
#define FX816_RF_NUM_CHANNELS 4
|
||||
#define FX816_PAYLOAD_SIZE 6
|
||||
#define FX816_BIND_COUNT 300 //3sec
|
||||
|
||||
static void __attribute__((unused)) FX816_send_packet()
|
||||
{
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
packet[0] = 0x55;
|
||||
else
|
||||
{
|
||||
XN297_Hopping(hopping_frequency_no++);
|
||||
hopping_frequency_no%=FX816_RF_NUM_CHANNELS;
|
||||
packet[0] = 0xAA;
|
||||
}
|
||||
packet[1] = rx_tx_addr[0];
|
||||
packet[2] = rx_tx_addr[1];
|
||||
uint8_t val=convert_channel_8b(AILERON);
|
||||
#define FX816_SWITCH 20
|
||||
if(val>127+FX816_SWITCH)
|
||||
packet[3] = 1;
|
||||
else if(val<127-FX816_SWITCH)
|
||||
packet[3] = 2;
|
||||
else
|
||||
packet[3] = 0;
|
||||
packet[4] = convert_channel_16b_limit(THROTTLE,0,100);
|
||||
val=0;
|
||||
for(uint8_t i=0;i<FX816_PAYLOAD_SIZE-1;i++)
|
||||
val+=packet[i];
|
||||
packet[5]=val;
|
||||
|
||||
// Send
|
||||
XN297_SetPower();
|
||||
XN297_SetTxRxMode(TX_EN);
|
||||
XN297_WritePayload(packet, FX816_PAYLOAD_SIZE);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) FX816_RF_init()
|
||||
{
|
||||
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
|
||||
XN297_SetTXAddr((uint8_t *)"\xcc\xcc\xcc\xcc\xcc", 5);
|
||||
//XN297_HoppingCalib(FX816_RF_NUM_CHANNELS);
|
||||
XN297_RFChannel(FX816_RF_BIND_CHANNEL);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) FX816_initialize_txid()
|
||||
{
|
||||
//Only 8 IDs: the RX led does not indicate frame loss.
|
||||
//I didn't open the plane to find out if I could connect there so this is the best I came up with with few trial and errors...
|
||||
rx_tx_addr[0]=0x35+(rx_tx_addr[3]&0x07); //Original dump=0x35
|
||||
rx_tx_addr[1]=0x09; //Original dump=0x09
|
||||
memcpy(hopping_frequency,"\x09\x1B\x30\x42",FX816_RF_NUM_CHANNELS); //Original dump=9=0x09,27=0x1B,48=0x30,66=0x42
|
||||
for(uint8_t i=0;i<FX816_RF_NUM_CHANNELS;i++)
|
||||
hopping_frequency[i]+=rx_tx_addr[3]&0x07;
|
||||
}
|
||||
|
||||
uint16_t FX816_callback()
|
||||
{
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(FX816_PACKET_PERIOD);
|
||||
#endif
|
||||
if(bind_counter)
|
||||
if(--bind_counter==0)
|
||||
BIND_DONE;
|
||||
FX816_send_packet();
|
||||
return FX816_PACKET_PERIOD;
|
||||
}
|
||||
|
||||
void FX816_init()
|
||||
{
|
||||
BIND_IN_PROGRESS; // autobind protocol
|
||||
FX816_initialize_txid();
|
||||
FX816_RF_init();
|
||||
hopping_frequency_no = 0;
|
||||
bind_counter=FX816_BIND_COUNT;
|
||||
}
|
||||
|
||||
#endif
|
||||
177
Multiprotocol/FX_nrf24l01.ino
Normal file
177
Multiprotocol/FX_nrf24l01.ino
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
This project is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Multiprotocol is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// Compatible with FEI XIONG P38 plane.
|
||||
|
||||
#if defined(FX_NRF24L01_INO)
|
||||
|
||||
#include "iface_xn297.h"
|
||||
|
||||
#define FX_BIND_COUNT 300 //3sec
|
||||
#define FX_SWITCH 20
|
||||
#define FX_NUM_CHANNELS 4
|
||||
|
||||
#define FX816_PACKET_PERIOD 10000
|
||||
#define FX816_BIND_CHANNEL 40
|
||||
#define FX816_PAYLOAD_SIZE 6
|
||||
#define FX816_CH_OFFSET 3
|
||||
|
||||
#define FX620_PACKET_PERIOD 3250
|
||||
#define FX620_BIND_PACKET_PERIOD 4500
|
||||
#define FX620_BIND_CHANNEL 18
|
||||
#define FX620_PAYLOAD_SIZE 7
|
||||
#define FX620_CH_OFFSET 1
|
||||
|
||||
//#define FORCE_FX620_ID
|
||||
|
||||
static void __attribute__((unused)) FX_send_packet()
|
||||
{
|
||||
//Hopp
|
||||
if(IS_BIND_DONE)
|
||||
{
|
||||
XN297_Hopping(hopping_frequency_no++);
|
||||
hopping_frequency_no &= 0x03;
|
||||
}
|
||||
|
||||
memset(packet,0x00,packet_length);
|
||||
|
||||
//Channels
|
||||
uint8_t offset=sub_protocol == FX816 ? FX816_CH_OFFSET:FX620_CH_OFFSET;
|
||||
uint8_t val=convert_channel_8b(AILERON);
|
||||
if(val>127+FX_SWITCH)
|
||||
packet[offset] = sub_protocol == FX816 ? 1:0xFF;
|
||||
else if(val<127-FX_SWITCH)
|
||||
packet[offset] = sub_protocol == FX816 ? 2:0x00;
|
||||
else
|
||||
packet[offset] = sub_protocol == FX816 ? 0:0x7F;
|
||||
packet[offset+1] = convert_channel_16b_limit(THROTTLE,0,100); //FX816:0x00..0x63, FX620:0x00..0x5E but that should work
|
||||
|
||||
//Bind and specifics
|
||||
if(sub_protocol == FX816)
|
||||
{
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
packet[0] = 0x55;
|
||||
else
|
||||
packet[0] = 0xAA;
|
||||
packet[1] = rx_tx_addr[0];
|
||||
packet[2] = rx_tx_addr[1];
|
||||
}
|
||||
else //FX620
|
||||
{
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
memcpy(packet,rx_tx_addr,3);
|
||||
packet[3] = hopping_frequency[0];
|
||||
if(bind_counter > (FX_BIND_COUNT >> 1))
|
||||
packet[5] = 0x78;
|
||||
}
|
||||
else
|
||||
{
|
||||
packet[0] = 0x1F; // Is it based on ID??
|
||||
packet[5] = 0xAB; // Is it based on ID??
|
||||
}
|
||||
}
|
||||
|
||||
//Check
|
||||
val=0;
|
||||
for(uint8_t i=0;i<packet_length-1;i++)
|
||||
val+=packet[i];
|
||||
packet[packet_length-1]=val;
|
||||
|
||||
//Debug
|
||||
#if 0
|
||||
for(uint8_t i=0;i<packet_length;i++)
|
||||
debug("%02X ",packet[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
|
||||
// Send
|
||||
XN297_SetPower();
|
||||
XN297_SetTxRxMode(TX_EN);
|
||||
XN297_WritePayload(packet, packet_length);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) FX_RF_init()
|
||||
{
|
||||
XN297_Configure(XN297_CRCEN, XN297_SCRAMBLED, XN297_1M);
|
||||
if(sub_protocol == FX816)
|
||||
{
|
||||
XN297_SetTXAddr((uint8_t *)"\xcc\xcc\xcc\xcc\xcc", 5);
|
||||
XN297_RFChannel(FX816_BIND_CHANNEL);
|
||||
packet_period = FX816_PACKET_PERIOD;
|
||||
packet_length = FX816_PAYLOAD_SIZE;
|
||||
}
|
||||
else //FX620
|
||||
{
|
||||
XN297_SetTXAddr((uint8_t *)"\xaa\xbb\xcc", 3);
|
||||
XN297_RFChannel(FX620_BIND_CHANNEL);
|
||||
packet_period = FX620_BIND_PACKET_PERIOD;
|
||||
packet_length = FX620_PAYLOAD_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) FX_initialize_txid()
|
||||
{
|
||||
if(sub_protocol == FX816)
|
||||
{
|
||||
//Only 8 IDs: the RX led does not indicate frame loss.
|
||||
//I didn't open the plane to find out if I could connect there so this is the best I came up with with few trial and errors...
|
||||
rx_tx_addr[0]=0x35+(rx_tx_addr[3]&0x07); //Original dump=0x35
|
||||
rx_tx_addr[1]=0x09; //Original dump=0x09
|
||||
memcpy(hopping_frequency,"\x09\x1B\x30\x42",FX_NUM_CHANNELS); //Original dump=9=0x09,27=0x1B,48=0x30,66=0x42
|
||||
for(uint8_t i=0;i<FX_NUM_CHANNELS;i++)
|
||||
hopping_frequency[i]+=rx_tx_addr[3]&0x07;
|
||||
}
|
||||
else//FX620
|
||||
{
|
||||
rx_tx_addr[0] = rx_tx_addr[3];
|
||||
hopping_frequency[0] = 0x18 + rx_tx_addr[3]&0x07; // just to try something
|
||||
#ifdef FORCE_FX620_ID
|
||||
memcpy(rx_tx_addr,(uint8_t*)"\x34\xA9\x32",3);
|
||||
hopping_frequency[0] = 0x18; //on dump: 24 34 44 54
|
||||
#endif
|
||||
for(uint8_t i=1;i<FX_NUM_CHANNELS;i++)
|
||||
hopping_frequency[i] = i*10 + hopping_frequency[0];
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t FX_callback()
|
||||
{
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#endif
|
||||
if(bind_counter)
|
||||
if(--bind_counter==0)
|
||||
{
|
||||
BIND_DONE;
|
||||
if(sub_protocol == FX620)
|
||||
{
|
||||
XN297_SetTXAddr(rx_tx_addr, 3);
|
||||
packet_period = FX620_PACKET_PERIOD;
|
||||
}
|
||||
}
|
||||
FX_send_packet();
|
||||
return packet_period;
|
||||
}
|
||||
|
||||
void FX_init()
|
||||
{
|
||||
BIND_IN_PROGRESS; // autobind protocol
|
||||
FX_initialize_txid();
|
||||
FX_RF_init();
|
||||
hopping_frequency_no = 0;
|
||||
bind_counter=FX_BIND_COUNT;
|
||||
}
|
||||
|
||||
#endif
|
||||
137
Multiprotocol/Kyosho2_nrf24l01.ino
Normal file
137
Multiprotocol/Kyosho2_nrf24l01.ino
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
This project is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Multiprotocol is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if defined(KYOSHO2_NRF24L01_INO)
|
||||
|
||||
#include "iface_nrf24l01.h"
|
||||
|
||||
#define KYOSHO2_PACKET_PERIOD 1120 // 1600 for bind, let's see
|
||||
#define KYOSHO2_BIND_COUNT 2000 // about 3sec
|
||||
#define KYOSHO2_BIND_CHANNEL 0x50
|
||||
#define KYOSHO2_PAYLOAD_SIZE 28
|
||||
#define KYOSHO2_RF_CHANNELS 15
|
||||
#define KYOSHO2_START_RF_CHANNEL 0x13 // No idea where it comes from... ID or unknown bytes during the bind?
|
||||
#define KYOSHO2_NUM_CHANNEL 10 // Only 4 on the dumps but there is space for 10 channels in the payload...
|
||||
|
||||
#define FORCE_KYOSHO2_ID
|
||||
|
||||
bool KYOSHO2_resend;
|
||||
//
|
||||
static void __attribute__((unused)) KYOSHO2_send_packet()
|
||||
{
|
||||
if(KYOSHO2_resend == true)
|
||||
{
|
||||
NRF24L01_Strobe(NRF24L01_E3_REUSE_TX_PL);
|
||||
if(IS_BIND_DONE)
|
||||
KYOSHO2_resend = false;
|
||||
return;
|
||||
}
|
||||
|
||||
memset(packet,0x00,KYOSHO2_PAYLOAD_SIZE);
|
||||
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
memcpy(packet, (uint8_t*)"\x01\x02\x05\x08\x1A\x2B\x3C\x4D", 8); // unknown bytes, parameters on how to build the rf channels?
|
||||
memcpy(&packet[8], rx_tx_addr, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(packet, rx_tx_addr, 4);
|
||||
//Hopp
|
||||
packet[6] = hopping_frequency_no + KYOSHO2_START_RF_CHANNEL;
|
||||
packet[7] = hopping_frequency[hopping_frequency_no];
|
||||
NRF24L01_WriteReg(NRF24L01_05_RF_CH, packet[6+(rf_ch_num&0x01)]);
|
||||
rf_ch_num++;
|
||||
//Channels
|
||||
uint16_t temp;
|
||||
for (uint8_t i = 0; i< KYOSHO2_NUM_CHANNEL; i++)
|
||||
{
|
||||
temp=convert_channel_16b_limit(i,0,0x3FF);
|
||||
packet[8+i*2] = temp >> 8;
|
||||
packet[9+i*2] = temp;
|
||||
}
|
||||
}
|
||||
//Send
|
||||
NRF24L01_WriteReg(NRF24L01_07_STATUS, (_BV(NRF24L01_07_TX_DS) | _BV(NRF24L01_07_MAX_RT))); // Reset flags
|
||||
NRF24L01_FlushTx();
|
||||
NRF24L01_WritePayload(packet,KYOSHO2_PAYLOAD_SIZE);
|
||||
NRF24L01_SetPower();
|
||||
KYOSHO2_resend = true;
|
||||
|
||||
#if 0
|
||||
for(uint8_t i=0;i<KYOSHO2_PAYLOAD_SIZE;i++)
|
||||
debug("%02X ", packet[i]);
|
||||
debugln("");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) KYOSHO2_RF_init()
|
||||
{
|
||||
NRF24L01_Initialize();
|
||||
NRF24L01_WriteReg(NRF24L01_05_RF_CH, KYOSHO2_BIND_CHANNEL);
|
||||
NRF24L01_WriteRegisterMulti(NRF24L01_10_TX_ADDR, (uint8_t*)"\x69\x53\x10\xAC\xEF", 5);
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) KYOSHO2_initialize_tx_id()
|
||||
{
|
||||
hopping_frequency_no = rx_tx_addr[3]%KYOSHO2_RF_CHANNELS;
|
||||
hopping_frequency[0] = 0x4A;
|
||||
#ifdef FORCE_KYOSHO2_ID
|
||||
memcpy(rx_tx_addr, (uint8_t*)"\x0A\xBD\x31\xDF", 4);
|
||||
hopping_frequency[0] = 0x4A; // No idea where it comes from... ID or unknown bytes during the bind?
|
||||
#endif
|
||||
for(uint8_t i=1;i<KYOSHO2_RF_CHANNELS;i++)
|
||||
{
|
||||
if(hopping_frequency[i-1]+5 < 0x50)
|
||||
hopping_frequency[i] = hopping_frequency[i-1]+5;
|
||||
else
|
||||
hopping_frequency[i] = hopping_frequency[i-1]-0x21;
|
||||
}
|
||||
#if 0
|
||||
for(uint8_t i=0;i<KYOSHO2_RF_CHANNELS;i++)
|
||||
debugln("1:%02X, 2: %02X", i + KYOSHO2_START_RF_CHANNEL, hopping_frequency[i]);
|
||||
debugln("Selected 1:%02X, 2: %02X", hopping_frequency_no + KYOSHO2_START_RF_CHANNEL, hopping_frequency[hopping_frequency_no]);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint16_t KYOSHO2_callback()
|
||||
{
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(KYOSHO2_PACKET_PERIOD);
|
||||
#endif
|
||||
if(bind_counter)
|
||||
if(--bind_counter==0)
|
||||
{
|
||||
BIND_DONE;
|
||||
KYOSHO2_resend = false;
|
||||
}
|
||||
KYOSHO2_send_packet();
|
||||
return KYOSHO2_PACKET_PERIOD;
|
||||
}
|
||||
|
||||
void KYOSHO2_init()
|
||||
{
|
||||
KYOSHO2_initialize_tx_id();
|
||||
KYOSHO2_RF_init();
|
||||
rf_ch_num = 0;
|
||||
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
bind_counter = KYOSHO2_BIND_COUNT;
|
||||
else
|
||||
bind_counter = 0;
|
||||
KYOSHO2_resend = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -27,15 +27,15 @@
|
||||
#define MT99XX_PACKET_PERIOD_DRAGON 1038 // there is a pause of 2x1038 between two packets, no idea why and how since it is not even stable on a same dump...
|
||||
#define MT99XX_PACKET_PERIOD_DRAGON_TELEM 10265 // long pause to receive the telemetry packets, 3 are sent by the RX one after the other
|
||||
#define MT99XX_PACKET_PERIOD_F949G 3450
|
||||
#define MT99XX_PACKET_PERIOD_PA18 1160
|
||||
#define MT99XX_PA18_CRC 0x89 // Is it a constant???
|
||||
#define MT99XX_PACKET_PERIOD_PA18 1338
|
||||
#define MT99XX_INITIAL_WAIT 500
|
||||
#define MT99XX_PACKET_SIZE 9
|
||||
|
||||
//#define FORCE_A180_ID
|
||||
//#define FORCE_DRAGON_ID
|
||||
//#define FORCE_F949G_ID
|
||||
#define FORCE_PA18_ID
|
||||
#define FORCE_PA18_ID1
|
||||
//#define FORCE_PA18_ID2
|
||||
|
||||
enum {
|
||||
MT99XX_DATA,
|
||||
@@ -115,10 +115,10 @@ static void __attribute__((unused)) MT99XX_send_packet()
|
||||
|
||||
//Set RF freq
|
||||
if(sub_protocol == LS)
|
||||
XN297_RFChannel(0x2D); // LS always transmits on the same channel
|
||||
XN297_RFChannel(0x2D); // LS always transmits on the same channel
|
||||
else
|
||||
if(sub_protocol==FY805)
|
||||
XN297_RFChannel(0x4B); // FY805 always transmits on the same channel
|
||||
XN297_RFChannel(0x4B); // FY805 always transmits on the same channel
|
||||
else // MT99 & H7 & YZ & A180 & DRAGON & F949G & PA18
|
||||
XN297_Hopping(hopping_frequency_no);
|
||||
|
||||
@@ -154,7 +154,7 @@ static void __attribute__((unused)) MT99XX_send_packet()
|
||||
packet[6] = rx_tx_addr[2];
|
||||
if(sub_protocol == PA18+8)
|
||||
{
|
||||
packet[7] = MT99XX_PA18_CRC; // checksum offset
|
||||
packet[7] = num_ch; // checksum offset
|
||||
packet[8] = 0x55; // fixed
|
||||
}
|
||||
else
|
||||
@@ -255,10 +255,10 @@ static void __attribute__((unused)) MT99XX_send_packet()
|
||||
break;
|
||||
case PA18+8:
|
||||
if(Channel_data[CH5] > CHANNEL_MAX_COMMAND) // Expert mode
|
||||
packet[5] += 0xA0;
|
||||
packet[5] = 0xA0;
|
||||
else
|
||||
if(Channel_data[CH5] > CHANNEL_MIN_COMMAND) // Intermediate mode
|
||||
packet[5] += 0x60;
|
||||
packet[5] = 0x60;
|
||||
packet[6] = GET_FLAG( CH6_SW, FLAG_PA18_FLIP ) // Flip
|
||||
| GET_FLAG( CH7_SW, FLAG_PA18_RTH ); // RTH
|
||||
if(hopping_frequency_no == 0)
|
||||
@@ -269,7 +269,7 @@ static void __attribute__((unused)) MT99XX_send_packet()
|
||||
for(uint8_t i=0; i<8; i++)
|
||||
result += packet[i];
|
||||
if(sub_protocol == PA18+8)
|
||||
result += MT99XX_PA18_CRC;
|
||||
result += num_ch;
|
||||
packet[8] = result;
|
||||
}
|
||||
else
|
||||
@@ -337,8 +337,8 @@ static void __attribute__((unused)) MT99XX_RF_init()
|
||||
|
||||
static void __attribute__((unused)) MT99XX_initialize_txid()
|
||||
{
|
||||
rx_tx_addr[1] = rx_tx_addr[3]; // RX_Num
|
||||
|
||||
num_ch = rx_tx_addr[1]; // PA18
|
||||
rx_tx_addr[1] = rx_tx_addr[3]; // RX_Num
|
||||
switch(sub_protocol)
|
||||
{
|
||||
case YZ:
|
||||
@@ -381,20 +381,35 @@ static void __attribute__((unused)) MT99XX_initialize_txid()
|
||||
//channel_offset = 0x03
|
||||
break;
|
||||
#endif
|
||||
#ifdef FORCE_PA18_ID
|
||||
#ifdef FORCE_PA18_ID1
|
||||
case PA18+8:
|
||||
rx_tx_addr[0] = 0xC9; // zebble ID
|
||||
rx_tx_addr[1] = 0x02;
|
||||
rx_tx_addr[2] = 0x13;
|
||||
num_ch = 0x89; // additional crc init. How is this calculated? or could it be random?
|
||||
//crc8 = 0xDE
|
||||
// additional crc init of 0x89, how is this calculated???
|
||||
//channel_offset = 0x03
|
||||
//1Mb C=5 S=Y A= C9 02 13 CC CC P(9)= E1 70 70 70 20 20 00 20 1A
|
||||
//1Mb C=5 S=Y A= C9 02 13 CC CC P(9)= E1 70 70 70 20 20 00 20 1A -> 0x91 + 0x89 => 0x1A
|
||||
// S=Y A= C9 02 13 CC CC P(9)= E1 70 70 70 20 A0 00 20 9A -> 0x11 + 0x89 => 0x9A
|
||||
//bind S=Y A= CC CC CC CC CC P(9)= 20 14 03 25 C9 02 13 89 55
|
||||
break;
|
||||
#endif
|
||||
default: //MT99 & H7 & A180 & DRAGON & F949G
|
||||
#ifdef FORCE_PA18_ID2
|
||||
case PA18+8:
|
||||
rx_tx_addr[0] = 0x0E;
|
||||
rx_tx_addr[1] = 0x05;
|
||||
rx_tx_addr[2] = 0x13;
|
||||
num_ch = 0xD1; // additional crc init. How is this calculated? or could it be random?
|
||||
//crc8 = 0x28
|
||||
//channel_offset = 0x00
|
||||
//1Mb C=2 S=Y A= 0E 05 13 CC CC P(9)= E1 70 70 70 20 60 00 60 E2 -> 0x11 + 0xD1 => 0xE2
|
||||
//bind S=Y A= CC CC CC CC CC P(9)= 20 14 03 25 0E 05 13 D1 55
|
||||
break;
|
||||
#endif
|
||||
default: //MT99 & H7 & A180 & DRAGON & F949G & PA18
|
||||
rx_tx_addr[2] = 0x00;
|
||||
if(sub_protocol == PA18+8)
|
||||
rx_tx_addr[2] = 0x13;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
45,E01X,E012,E015
|
||||
46,V911S,V911S,E119
|
||||
47,GD00x,GD_V1,GD_V2
|
||||
48,V761,3CH,4CH
|
||||
48,V761,3CH,4CH,TOPRC
|
||||
49,KF606,KF606,MIG320
|
||||
50,Redpine,Fast,Slow
|
||||
51,Potensic,A20
|
||||
@@ -55,7 +55,7 @@
|
||||
55,Frsky_RX,Multi,CloneTX,EraseTX,CPPM
|
||||
56,AFHDS2A_RX,Multi,CPPM
|
||||
57,HoTT,Sync,No_Sync
|
||||
58,FX816
|
||||
58,FX,816,620
|
||||
59,Bayang_RX,Multi,CPPM
|
||||
60,Pelikan,Pro,Lite,SCX24
|
||||
61,Tiger
|
||||
@@ -88,4 +88,5 @@
|
||||
89,Losi
|
||||
90,MouldKg,Analog,Digit
|
||||
91,Xerall
|
||||
92,MT99xx,PA18
|
||||
92,MT99xx,PA18
|
||||
93,Kyosho2,KT-17
|
||||
|
||||
@@ -78,7 +78,7 @@ const char STR_SCANNER[] ="Scanner";
|
||||
const char STR_FRSKY_RX[] ="FrSkyRX";
|
||||
const char STR_AFHDS2A_RX[] ="FS2A_RX";
|
||||
const char STR_HOTT[] ="HoTT";
|
||||
const char STR_FX816[] ="FX816";
|
||||
const char STR_FX[] ="FX";
|
||||
const char STR_BAYANG_RX[] ="BayanRX";
|
||||
const char STR_PELIKAN[] ="Pelikan";
|
||||
const char STR_TIGER[] ="Tiger";
|
||||
@@ -88,6 +88,7 @@ const char STR_FRSKYR9[] ="FrSkyR9";
|
||||
const char STR_PROPEL[] ="Propel";
|
||||
const char STR_SKYARTEC[] ="Skyartc";
|
||||
const char STR_KYOSHO[] ="Kyosho";
|
||||
const char STR_KYOSHO2[] ="Kyosho2";
|
||||
const char STR_RLINK[] ="RadLink";
|
||||
const char STR_REALACC[] ="Realacc";
|
||||
const char STR_OMP[] ="OMP";
|
||||
@@ -154,16 +155,17 @@ const char STR_SUBTYPE_WFLY[] = "\x05""WFR0x";
|
||||
const char STR_SUBTYPE_WFLY2[] = "\x05""RF20x";
|
||||
const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync";
|
||||
const char STR_SUBTYPE_PELIKAN[] = "\x05""Pro\0 ""Lite\0""SCX24";
|
||||
const char STR_SUBTYPE_V761[] = "\x03""3ch""4ch";
|
||||
const char STR_SUBTYPE_V761[] = "\x05""3ch\0 ""4ch\0 ""TOPRC";
|
||||
const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC";
|
||||
const char STR_SUBTYPE_REALACC[] = "\x03""R11";
|
||||
const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype";
|
||||
const char STR_SUBTYPE_KYOSHO2[] = "\x05""KT-17";
|
||||
const char STR_SUBTYPE_FUTABA[] = "\x05""SFHSS";
|
||||
const char STR_SUBTYPE_JJRC345[] = "\x08""JJRC345\0""SkyTmblr";
|
||||
const char STR_SUBTYPE_MOULKG[] = "\x06""Analog""Digit\0";
|
||||
const char STR_SUBTYPE_KF606[] = "\x06""KF606\0""MIG320";
|
||||
const char STR_SUBTYPE_E129[] = "\x04""E129""C186";
|
||||
|
||||
const char STR_SUBTYPE_FX[] = "\x03""816""620";
|
||||
#define NO_SUBTYPE nullptr
|
||||
|
||||
#ifdef SEND_CPPM
|
||||
@@ -304,8 +306,8 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#if defined(FUTABA_CC2500_INO)
|
||||
{PROTO_FUTABA, STR_FUTABA, STR_SUBTYPE_FUTABA, 1, OPTION_RFTUNE, 1, 1, SW_CC2500, SFHSS_init, SFHSS_callback },
|
||||
#endif
|
||||
#if defined(FX816_NRF24L01_INO)
|
||||
{PROTO_FX816, STR_FX816, NO_SUBTYPE, 0, OPTION_NONE, 0, 0, SW_NRF, FX816_init, FX816_callback },
|
||||
#if defined(FX_NRF24L01_INO)
|
||||
{PROTO_FX, STR_FX, STR_SUBTYPE_FX, 2, OPTION_NONE, 0, 0, SW_NRF, FX_init, FX_callback },
|
||||
#endif
|
||||
#if defined(FY326_NRF24L01_INO)
|
||||
{PROTO_FY326, STR_FY326, STR_SUBTYPE_FY326, 2, OPTION_NONE, 0, 0, SW_NRF, FY326_init, FY326_callback },
|
||||
@@ -358,6 +360,9 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
#if defined(KYOSHO_A7105_INO)
|
||||
{PROTO_KYOSHO, STR_KYOSHO, STR_SUBTYPE_KYOSHO, 2, OPTION_NONE, 0, 1, SW_A7105, KYOSHO_init, KYOSHO_callback },
|
||||
#endif
|
||||
#if defined(KYOSHO2_NRF24L01_INO)
|
||||
{PROTO_KYOSHO2, STR_KYOSHO2, STR_SUBTYPE_KYOSHO2, 1, OPTION_NONE, 0, 0, SW_NRF, KYOSHO2_init, KYOSHO2_callback },
|
||||
#endif
|
||||
#if defined(LOLI_NRF24L01_INO)
|
||||
{PROTO_LOLI, STR_LOLI, NO_SUBTYPE, 0, OPTION_NONE, 1, 0, SW_NRF, LOLI_init, LOLI_callback },
|
||||
#endif
|
||||
@@ -437,7 +442,7 @@ const mm_protocol_definition multi_protocols[] = {
|
||||
{PROTO_V2X2, STR_V2X2, STR_SUBTYPE_V2X2, 3, OPTION_NONE, 0, 0, SW_NRF, V2X2_init, V2X2_callback },
|
||||
#endif
|
||||
#if defined(V761_NRF24L01_INO)
|
||||
{PROTO_V761, STR_V761, STR_SUBTYPE_V761, 2, OPTION_NONE, 0, 0, SW_NRF, V761_init, V761_callback },
|
||||
{PROTO_V761, STR_V761, STR_SUBTYPE_V761, 3, OPTION_NONE, 0, 0, SW_NRF, V761_init, V761_callback },
|
||||
#endif
|
||||
#if defined(V911S_CCNRF_INO)
|
||||
{PROTO_V911S, STR_V911S, STR_SUBTYPE_V911S, 2, OPTION_RFTUNE, 0, 0, SW_NRF, V911S_init, V911S_callback },
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 3
|
||||
#define VERSION_PATCH_LEVEL 14
|
||||
#define VERSION_PATCH_LEVEL 20
|
||||
|
||||
#define MODE_SERIAL 0
|
||||
|
||||
@@ -86,7 +86,7 @@ enum PROTOCOLS
|
||||
PROTO_FRSKY_RX = 55, // =>CC2500
|
||||
PROTO_AFHDS2A_RX= 56, // =>A7105
|
||||
PROTO_HOTT = 57, // =>CC2500
|
||||
PROTO_FX816 = 58, // =>NRF24L01
|
||||
PROTO_FX = 58, // =>NRF24L01
|
||||
PROTO_BAYANG_RX = 59, // =>NRF24L01
|
||||
PROTO_PELIKAN = 60, // =>A7105
|
||||
PROTO_TIGER = 61, // =>NRF24L01
|
||||
@@ -120,6 +120,7 @@ enum PROTOCOLS
|
||||
PROTO_MOULDKG = 90, // =>NRF24L01
|
||||
PROTO_XERALL = 91, // =>NRF24L01
|
||||
PROTO_MT99XX2 = 92, // =>NRF24L01, extension of MT99XX protocol
|
||||
PROTO_KYOSHO2 = 93, // =>NRF24L01
|
||||
|
||||
PROTO_NANORF = 126, // =>NRF24L01
|
||||
PROTO_TEST = 127, // =>CC2500
|
||||
@@ -390,7 +391,6 @@ enum ESKY
|
||||
ESKY_STD = 0,
|
||||
ESKY_ET4 = 1,
|
||||
};
|
||||
|
||||
enum FRSKY_RX
|
||||
{
|
||||
FRSKY_RX = 0,
|
||||
@@ -398,74 +398,69 @@ enum FRSKY_RX
|
||||
FRSKY_ERASE = 2,
|
||||
FRSKY_CPPM = 3,
|
||||
};
|
||||
|
||||
enum FRSKYL
|
||||
{
|
||||
LR12 = 0,
|
||||
LR12_6CH = 1,
|
||||
};
|
||||
|
||||
enum HOTT
|
||||
{
|
||||
HOTT_SYNC = 0,
|
||||
HOTT_NO_SYNC= 1,
|
||||
};
|
||||
|
||||
enum PELIKAN
|
||||
{
|
||||
PELIKAN_PRO = 0,
|
||||
PELIKAN_LITE= 1,
|
||||
PELIKAN_SCX24=2,
|
||||
};
|
||||
|
||||
enum V761
|
||||
{
|
||||
V761_3CH = 0,
|
||||
V761_4CH = 1,
|
||||
V761_TOPRC = 2,
|
||||
};
|
||||
|
||||
enum HEIGHT
|
||||
{
|
||||
HEIGHT_5CH = 0,
|
||||
HEIGHT_8CH = 1,
|
||||
};
|
||||
|
||||
enum KYOSHO
|
||||
{
|
||||
KYOSHO_FHSS = 0,
|
||||
KYOSHO_HYPE = 1,
|
||||
};
|
||||
|
||||
enum JJRC345
|
||||
{
|
||||
JJRC345 = 0,
|
||||
SKYTMBLR = 1,
|
||||
};
|
||||
|
||||
enum RLINK
|
||||
{
|
||||
RLINK_SURFACE = 0,
|
||||
RLINK_AIR = 1,
|
||||
RLINK_DUMBORC = 2,
|
||||
};
|
||||
|
||||
enum MOULDKG
|
||||
{
|
||||
MOULDKG_ANALOG = 0,
|
||||
MOULDKG_DIGIT = 1,
|
||||
};
|
||||
|
||||
enum KF606
|
||||
{
|
||||
KF606_KF606 = 0,
|
||||
KF606_MIG320 = 1,
|
||||
};
|
||||
|
||||
enum E129
|
||||
{
|
||||
E129_E129 = 0,
|
||||
E129_C186 = 1,
|
||||
};
|
||||
enum FX
|
||||
{
|
||||
FX816 = 0,
|
||||
FX620 = 1,
|
||||
};
|
||||
|
||||
#define NONE 0
|
||||
#define P_HIGH 1
|
||||
@@ -911,7 +906,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
||||
FRSKY_RX 55
|
||||
AFHDS2A_RX 56
|
||||
HOTT 57
|
||||
FX816 58
|
||||
FX 58
|
||||
BAYANG_RX 59
|
||||
PELIKAN 60
|
||||
TIGER 61
|
||||
|
||||
@@ -25,13 +25,15 @@ Multiprotocol is distributed in the hope that it will be useful,
|
||||
#define V761_BIND_COUNT 200
|
||||
#define V761_BIND_FREQ 0x28
|
||||
#define V761_RF_NUM_CHANNELS 3
|
||||
#define TOPRC_BIND_FREQ 0x2A
|
||||
#define TOPRC_PACKET_PERIOD 14120 // Timeout for callback in uSec
|
||||
|
||||
enum
|
||||
{
|
||||
{
|
||||
V761_BIND1 = 0,
|
||||
V761_BIND2,
|
||||
V761_DATA
|
||||
};
|
||||
};
|
||||
|
||||
static void __attribute__((unused)) V761_set_checksum()
|
||||
{
|
||||
@@ -56,14 +58,11 @@ static void __attribute__((unused)) V761_send_packet()
|
||||
|
||||
if(phase != V761_DATA)
|
||||
{
|
||||
packet[0] = rx_tx_addr[0];
|
||||
packet[1] = rx_tx_addr[1];
|
||||
packet[2] = rx_tx_addr[2];
|
||||
packet[3] = rx_tx_addr[3];
|
||||
memcpy(packet, rx_tx_addr, 4);
|
||||
packet[4] = hopping_frequency[1];
|
||||
packet[5] = hopping_frequency[2];
|
||||
if(phase == V761_BIND2)
|
||||
packet[6] = 0xf0; // ?
|
||||
packet[6] = 0xF0; // ?
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -72,23 +71,22 @@ static void __attribute__((unused)) V761_send_packet()
|
||||
{
|
||||
hopping_frequency_no = 0;
|
||||
packet_count++;
|
||||
if(packet_count >= 4)
|
||||
packet_count = 0;
|
||||
packet_count &= 0x03;
|
||||
}
|
||||
|
||||
packet[0] = convert_channel_8b(THROTTLE); // Throttle
|
||||
packet[2] = convert_channel_8b(ELEVATOR)>>1; // Elevator
|
||||
|
||||
if(sub_protocol==V761_3CH)
|
||||
{
|
||||
packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder
|
||||
packet[3] = convert_channel_8b(AILERON)>>1; // Aileron
|
||||
}
|
||||
else
|
||||
if(sub_protocol == V761_4CH || sub_protocol == V761_TOPRC)
|
||||
{
|
||||
packet[1] = convert_channel_8b(AILERON)>>1; // Aileron
|
||||
packet[3] = convert_channel_8b(RUDDER)>>1; // Rudder
|
||||
}
|
||||
else
|
||||
{
|
||||
packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder
|
||||
packet[3] = convert_channel_8b(AILERON)>>1; // Aileron
|
||||
}
|
||||
|
||||
packet[5] = packet_count<<6; // 0X, 4X, 8X, CX
|
||||
packet[4] = 0x20; // Trims 00..20..40, 0X->20 4X->TrAil 8X->TrEle CX->TrRud
|
||||
@@ -112,7 +110,7 @@ static void __attribute__((unused)) V761_send_packet()
|
||||
packet[6] = GET_FLAG(CH7_SW, 0x20) // Flip
|
||||
|GET_FLAG(CH8_SW, 0x08) // RTH activation
|
||||
|GET_FLAG(CH9_SW, 0x10); // RTH on/off
|
||||
if(sub_protocol==V761_3CH)
|
||||
if(sub_protocol == V761_3CH)
|
||||
packet[6] |= 0x80; // Unknown, set on original V761-1 dump but not on eachine dumps, keeping for compatibility
|
||||
}
|
||||
V761_set_checksum();
|
||||
@@ -137,28 +135,36 @@ static void __attribute__((unused)) V761_RF_init()
|
||||
static void __attribute__((unused)) V761_initialize_txid()
|
||||
{
|
||||
#ifdef V761_FORCE_ID
|
||||
switch(RX_num%5)
|
||||
if(sub_protocol == V761_TOPRC)
|
||||
{ //Dump from air on TopRCHobby TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\xD5\x01\x00\x00",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x2E\x41",2);
|
||||
}
|
||||
else
|
||||
{
|
||||
case 1: //Dump from air on Protonus TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
|
||||
break;
|
||||
case 2: //Dump from air on mshagg2 TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x13\x1D",2);
|
||||
break;
|
||||
case 3: //Dump from air on MikeHRC Eachine TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\x08\x03\x00\xA0",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
|
||||
break;
|
||||
case 4: //Dump from air on Crashanium Eachine TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",2);
|
||||
break;
|
||||
default: //Dump from SPI
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",2);
|
||||
break;
|
||||
switch(RX_num%5)
|
||||
{
|
||||
case 1: //Dump from air on Protonus TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
|
||||
break;
|
||||
case 2: //Dump from air on mshagg2 TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x13\x1D",2);
|
||||
break;
|
||||
case 3: //Dump from air on MikeHRC Eachine TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\x08\x03\x00\xA0",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
|
||||
break;
|
||||
case 4: //Dump from air on Crashanium Eachine TX
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",2);
|
||||
break;
|
||||
default: //Dump from SPI
|
||||
memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4);
|
||||
memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
//Tested with Eachine RX
|
||||
@@ -180,8 +186,8 @@ uint16_t V761_callback()
|
||||
if(bind_counter)
|
||||
bind_counter--;
|
||||
packet_count ++;
|
||||
XN297_RFChannel(V761_BIND_FREQ);
|
||||
XN297_SetTXAddr((uint8_t*)"\x34\x43\x10\x10", 4);
|
||||
XN297_RFChannel(sub_protocol == V761_TOPRC ? TOPRC_BIND_FREQ : V761_BIND_FREQ);
|
||||
XN297_SetTXAddr(rx_id, 4);
|
||||
V761_send_packet();
|
||||
if(packet_count >= 20)
|
||||
{
|
||||
@@ -210,17 +216,28 @@ uint16_t V761_callback()
|
||||
return 15730;
|
||||
case V761_DATA:
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(V761_PACKET_PERIOD);
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#endif
|
||||
V761_send_packet();
|
||||
break;
|
||||
}
|
||||
return V761_PACKET_PERIOD;
|
||||
return packet_period;
|
||||
}
|
||||
|
||||
void V761_init(void)
|
||||
{
|
||||
V761_initialize_txid();
|
||||
if(sub_protocol == V761_TOPRC)
|
||||
{
|
||||
memcpy(rx_id,(uint8_t*)"\x20\x21\x05\x0A",4);
|
||||
packet_period = TOPRC_PACKET_PERIOD;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(rx_id,(uint8_t*)"\x34\x43\x10\x10",4);
|
||||
packet_period = V761_PACKET_PERIOD;
|
||||
}
|
||||
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
{
|
||||
bind_counter = V761_BIND_COUNT;
|
||||
@@ -231,7 +248,7 @@ void V761_init(void)
|
||||
XN297_SetTXAddr(rx_tx_addr, 4);
|
||||
phase = V761_DATA;
|
||||
}
|
||||
|
||||
|
||||
V761_RF_init();
|
||||
hopping_frequency_no = 0;
|
||||
packet_count = 0;
|
||||
|
||||
@@ -242,16 +242,16 @@
|
||||
|
||||
//Make sure protocols are selected correctly
|
||||
#ifndef A7105_INSTALLED
|
||||
#undef AFHDS2A_A7105_INO
|
||||
#undef AFHDS2A_RX_A7105_INO
|
||||
#undef BUGS_A7105_INO
|
||||
#undef FLYSKY_A7105_INO
|
||||
#undef HEIGHT_A7105_INO
|
||||
#undef HUBSAN_A7105_INO
|
||||
#undef JOYSWAY_A7105_INO
|
||||
#undef KYOSHO_A7105_INO
|
||||
#undef PELIKAN_A7105_INO
|
||||
#undef WFLY2_A7105_INO
|
||||
#undef AFHDS2A_A7105_INO
|
||||
#undef AFHDS2A_RX_A7105_INO
|
||||
#undef BUGS_A7105_INO
|
||||
#undef FLYSKY_A7105_INO
|
||||
#undef HEIGHT_A7105_INO
|
||||
#undef HUBSAN_A7105_INO
|
||||
#undef JOYSWAY_A7105_INO
|
||||
#undef KYOSHO_A7105_INO
|
||||
#undef PELIKAN_A7105_INO
|
||||
#undef WFLY2_A7105_INO
|
||||
#endif
|
||||
#ifndef CYRF6936_INSTALLED
|
||||
#undef DEVO_CYRF6936_INO
|
||||
@@ -299,7 +299,7 @@
|
||||
#undef ESKY_NRF24L01_INO
|
||||
#undef ESKY150_NRF24L01_INO
|
||||
#undef FQ777_NRF24L01_INO
|
||||
#undef FX816_NRF24L01_INO
|
||||
#undef FX_NRF24L01_INO
|
||||
#undef FY326_NRF24L01_INO
|
||||
#undef GW008_NRF24L01_INO
|
||||
#undef H8_3D_NRF24L01_INO
|
||||
@@ -307,6 +307,7 @@
|
||||
#undef HONTAI_NRF24L01_INO
|
||||
#undef JJRC345_NRF24L01_INO
|
||||
#undef KN_NRF24L01_INO
|
||||
#undef KYOSHO2_NRF24L01_INO
|
||||
#undef LOLI_NRF24L01_INO
|
||||
#undef MOULDKG_NRF24L01_INO
|
||||
#undef NCC1701_NRF24L01_INO
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
#define ESKY_NRF24L01_INO
|
||||
#define ESKY150_NRF24L01_INO
|
||||
#define FQ777_NRF24L01_INO
|
||||
#define FX816_NRF24L01_INO
|
||||
#define FX_NRF24L01_INO
|
||||
#define FY326_NRF24L01_INO
|
||||
#define GW008_NRF24L01_INO
|
||||
#define HISKY_NRF24L01_INO
|
||||
@@ -237,6 +237,7 @@
|
||||
#define H8_3D_NRF24L01_INO
|
||||
#define JJRC345_NRF24L01_INO
|
||||
#define KN_NRF24L01_INO
|
||||
#define KYOSHO2_NRF24L01_INO
|
||||
#define LOLI_NRF24L01_INO
|
||||
//#define MOULDKG_NRF24L01_INO
|
||||
#define NCC1701_NRF24L01_INO
|
||||
@@ -666,8 +667,9 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
PROTO_FRSKY_RX
|
||||
FRSKY_RX
|
||||
FRSKY_CLONE
|
||||
PROTO_FX816
|
||||
NONE
|
||||
PROTO_FX
|
||||
FX816
|
||||
FX620
|
||||
PROTO_FY326
|
||||
FY326
|
||||
FY319
|
||||
@@ -721,6 +723,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
|
||||
PROTO_KYOSHO
|
||||
KYOSHO_FHSS
|
||||
KYOSHO_HYPE
|
||||
PROTO_KYOSHO2
|
||||
NONE
|
||||
PROTO_LOLI
|
||||
NONE
|
||||
PROTO_LOSI
|
||||
|
||||
@@ -96,7 +96,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[FrskyX2](Protocols_Details.md#FRSKYX2---64)|64|CH_16|CH_8|EU_16|EU_8|Cloned|Cloned_8|||CC2500|
|
||||
[Frsky_RX](Protocols_Details.md#FRSKY_RX---55)|55|Multi|CloneTX|EraseTX|CPPM|||||CC2500|
|
||||
[Futaba/SFHSS](Protocols_Details.md#Futaba---21)|21|SFHSS||||||||CC2500|
|
||||
[FX816](Protocols_Details.md#FX816---58)|28|FX816||||||||NRF24L01|
|
||||
[FX](Protocols_Details.md#FX---58)|28|816|620|||||||NRF24L01|
|
||||
[FY326](Protocols_Details.md#FY326---20)|20|FY326|FY319|||||||NRF24L01|
|
||||
[GD00X](Protocols_Details.md#GD00X---47)|47|GD_V1*|GD_V2*|||||||NRF24L01|XN297L
|
||||
[GW008](Protocols_Details.md#GW008---32)|32|||||||||NRF24L01|XN297
|
||||
@@ -113,6 +113,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[KF606](Protocols_Details.md#KF606---49)|49|KF606|MIG320|||||||NRF24L01|XN297
|
||||
[KN](Protocols_Details.md#KN---9)|9|WLTOYS|FEILUN|||||||NRF24L01|
|
||||
[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105|
|
||||
[Kyosho2](Protocols_Details.md#Kyosho2---93)|93|KT-17||||||||NRF24L01|
|
||||
[LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01|
|
||||
[Losi](Protocols_Details.md#Losi---89)|89|||||||||CYRF6936|
|
||||
[MJXq](Protocols_Details.md#MJXQ---18)|18|WLH08|X600|X800|H26D|E010*|H26WH|PHOENIX*||NRF24L01|XN297
|
||||
@@ -140,7 +141,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[Tiger](Protocols_Details.md#Tiger---61)|61|||||||||NRF24L01|XN297
|
||||
[Traxxas](Protocols_Details.md#Traxxas---43)|43|6519 RX||||||||CYRF6936|
|
||||
[V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|MR101||||||NRF24L01|
|
||||
[V761](Protocols_Details.md#V761---48)|48|3CH|4CH|||||||NRF24L01|XN297
|
||||
[V761](Protocols_Details.md#V761---48)|48|3CH|4CH|TOPRC||||||NRF24L01|XN297
|
||||
[V911S](Protocols_Details.md#V911S---46)|46|V911S*|E119*|||||||NRF24L01|XN297
|
||||
[WFLY](Protocols_Details.md#WFLY---40)|40|WFR0x||||||||CYRF6936|
|
||||
[WFLY2](Protocols_Details.md#WFLY2---79)|79|RF20x||||||||A7105|
|
||||
@@ -1600,15 +1601,21 @@ A|E|T|R|FMODE|AUX6|AUX7
|
||||
|
||||
FMODE and AUX7 have 4 positions: -100%..-50%=>0, -50%..5%=>1, 5%..50%=>2, 50%..100%=>3
|
||||
|
||||
## FX816 - *58*
|
||||
Model: FEI XIONG FX P38, B17
|
||||
|
||||
Only 8 TX IDs available
|
||||
## FX - *58*
|
||||
FEI XIONG
|
||||
|
||||
CH1|CH2|CH3|CH4
|
||||
---|---|---|---
|
||||
A|-|T|-
|
||||
|
||||
### Sub_protocol 816 - *0*
|
||||
Model: FX816 P38, B17
|
||||
|
||||
Only 8 TX IDs available
|
||||
|
||||
### Sub_protocol 620 - *1*
|
||||
Model: FX620 SU35
|
||||
|
||||
## FY326 - *20*
|
||||
|
||||
### Sub_protocol FY326 - *0*
|
||||
@@ -1725,6 +1732,13 @@ Model: DF-Models SkyTumbler
|
||||
|
||||
RTH not supported
|
||||
|
||||
## KYOSHO2 - *93*
|
||||
Model: TX KT-17, Minium Edge 540, Minium Citabria
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
|
||||
---|---|---|---|---|---|---|---|---|----
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10
|
||||
|
||||
## LOLI - *82*
|
||||
LOLI3 receivers: https://github.com/wooddoor/Loli3
|
||||
|
||||
@@ -1937,14 +1951,21 @@ Flip: momentary switch: hold flip(+100%), indicate flip direction with Ele or Ai
|
||||
RTN_ACT and RTN: -100% disable, +100% enable
|
||||
|
||||
### Sub_protocol 3CH - *0*
|
||||
Model: Volantex V761-1, V761-3 and may be others
|
||||
Models: Volantex V761-1, V761-3 and may be others
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
||||
---|---|---|---|---|---|---|---|---
|
||||
-|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
|
||||
|
||||
### Sub_protocol 4CH - *1*
|
||||
Model: Volantex V761-4+ and Eachine P51-D, F4U, F22 and may be others
|
||||
Models: Volantex V761-4+ and Eachine P51-D, F4U, F22 and may be others
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
||||
---|---|---|---|---|---|---|---|---
|
||||
A|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
|
||||
|
||||
### Sub_protocol TOPRC - *2*
|
||||
Models: Top RC Hobby Spitfire, P51D, BF-109
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
|
||||
---|---|---|---|---|---|---|---|---
|
||||
|
||||
@@ -9,11 +9,11 @@ getMultiVersion() {
|
||||
}
|
||||
|
||||
getAllRFModules() {
|
||||
if [[ "$BOARD" =~ "multi4in1:avr:multixmega32d4" ]]; then
|
||||
if [[ "$BOARD" =~ ":avr:multixmega32d4" ]]; then
|
||||
ALL_RFMODULES=$(echo CYRF6936_INSTALLED);
|
||||
elif [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:" ]]; then
|
||||
elif [[ "$BOARD" =~ ":avr:multiatmega328p:" ]]; then
|
||||
ALL_RFMODULES=$(echo A7105_INSTALLED CYRF6936_INSTALLED CC2500_INSTALLED NRF24L01_INSTALLED);
|
||||
elif [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:" ]]; then
|
||||
ALL_RFMODULES=$(echo A7105_INSTALLED CYRF6936_INSTALLED CC2500_INSTALLED NRF24L01_INSTALLED SX1276_INSTALLED);
|
||||
fi
|
||||
}
|
||||
@@ -26,11 +26,11 @@ getAllProtocols() {
|
||||
CCNRF_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_CCNRF_INO\)\(.*\)/\1/p' Multiprotocol/_Config.h)
|
||||
SX1276_PROTOCOLS=$(sed -n 's/[\/\/]*[[:blank:]]*#define[[:blank:]]*\([[:alnum:]_]*_SX1276_INO\)\(.*\)/\1/p' Multiprotocol/_Config.h)
|
||||
|
||||
if [[ "$BOARD" =~ "multi4in1:avr:multixmega32d4" ]]; then
|
||||
if [[ "$BOARD" =~ ":avr:multixmega32d4" ]]; then
|
||||
ALL_PROTOCOLS=$(echo $CYRF6936_PROTOCOLS);
|
||||
elif [[ "$BOARD" =~ "multi4in1:avr:multiatmega328p:" ]]; then
|
||||
elif [[ "$BOARD" =~ ":avr:multiatmega328p:" ]]; then
|
||||
ALL_PROTOCOLS=$(echo $A7105_PROTOCOLS $CC2500_PROTOCOLS $CYRF6936_PROTOCOLS $NRF24L01_PROTOCOLS $CCNRF_PROTOCOLS);
|
||||
elif [[ "$BOARD" =~ "multi4in1:STM32F1:" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:" ]]; then
|
||||
ALL_PROTOCOLS=$(echo $A7105_PROTOCOLS $CC2500_PROTOCOLS $CYRF6936_PROTOCOLS $NRF24L01_PROTOCOLS $CCNRF_PROTOCOLS $SX1276_PROTOCOLS);
|
||||
fi
|
||||
}
|
||||
@@ -84,21 +84,21 @@ buildEachRFModule() {
|
||||
}
|
||||
|
||||
buildReleaseFiles(){
|
||||
if [[ "$BOARD" == "multi4in1:avr:multixmega32d4" ]]; then
|
||||
if [[ "$BOARD" =~ ":avr:multixmega32d4" ]]; then
|
||||
build_release_orx;
|
||||
elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
|
||||
elif [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=none" ]]; then
|
||||
build_release_avr_noboot;
|
||||
elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=optiboot" ]]; then
|
||||
elif [[ "$BOARD" =~ ":avr:multiatmega328p:bootloader=optiboot" ]]; then
|
||||
build_release_avr_optiboot;
|
||||
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103cb:debug_option=none" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=none" ]]; then
|
||||
build_release_stm32f1_no_debug;
|
||||
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103cb:debug_option=native" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=native" ]]; then
|
||||
build_release_stm32f1_native_debug;
|
||||
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103cb:debug_option=ftdi" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103cb:debug_option=ftdi" ]]; then
|
||||
build_release_stm32f1_serial_debug;
|
||||
elif [[ "$BOARD" == "multi4in1:STM32F1:multi5in1t18int" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multi5in1t18int" ]]; then
|
||||
build_release_stm32f1_t18int;
|
||||
elif [[ "$BOARD" == "multi4in1:STM32F1:multistm32f103c8:debug_option=none" ]]; then
|
||||
elif [[ "$BOARD" =~ ":STM32F1:multistm32f103c8:debug_option=none" ]]; then
|
||||
build_release_stm32f1_64k;
|
||||
else
|
||||
printf "No release files for this board.";
|
||||
|
||||
Reference in New Issue
Block a user