V761 additonal channels

This commit is contained in:
Pascal Langer 2020-06-27 17:55:36 +02:00
parent ce67a065cd
commit 7286049d07
7 changed files with 63 additions and 41 deletions

View File

@ -48,7 +48,8 @@ before_install:
buildMulti; buildMulti;
exitcode=$((exitcode+$?)); exitcode=$((exitcode+$?));
mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-blue-inv-v$MULTI_VERSION.bin; mv build/Multiprotocol.ino.bin ./binaries/multi-orangerx-aetr-blue-inv-v$MULTI_VERSION.bin;
cp Multiprotocol/Multi.txt ./binaries/Multi.txt; cp Multiprotocol/Multi.txt ./binaries/Multi.txt;
cp Lua_scripts/ ./binaries/;
return $exitcode; }; return $exitcode; };
elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then elif [[ "$BOARD" == "multi4in1:avr:multiatmega328p:bootloader=none" ]]; then
buildReleaseFiles(){ buildReleaseFiles(){

View File

@ -45,7 +45,7 @@
45,E01X,E012,E015,E016H 45,E01X,E012,E015,E016H
46,V911S,V911S,E119 46,V911S,V911S,E119
47,GD00x,GD_V1,GD_V2 47,GD00x,GD_V1,GD_V2
48,V761 48,V761,3CH,4CH
49,KF606 49,KF606
50,Redpine,Fast,Slow 50,Redpine,Fast,Slow
51,Potensic,A20 51,Potensic,A20

View File

@ -138,7 +138,7 @@ const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch";
const char STR_SUBTYPE_WFLY[] = "\x06""WFR0xS"; const char STR_SUBTYPE_WFLY[] = "\x06""WFR0xS";
const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync"; const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync";
const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite"; const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite";
const char STR_SUBTYPE_V761[] = "\x07""Std\0 ""Eachine"; const char STR_SUBTYPE_V761[] = "\x03""3CH""4CH";
enum enum
{ {

View File

@ -377,8 +377,8 @@ enum PELIKAN
enum V761 enum V761
{ {
V761_STD = 0, V761_3CH = 0,
V761_EACHINE= 1, V761_4CH = 1,
}; };
#define NONE 0 #define NONE 0
@ -974,8 +974,8 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
PELIKAN_PRO 0 PELIKAN_PRO 0
PELIKAN_LITE 1 PELIKAN_LITE 1
sub_protocol==V761 sub_protocol==V761
V761_STD 0 V761_3CH 0
V761_EACHINE 1 V761_4CH 1
Power value => 0x80 0=High/1=Low Power value => 0x80 0=High/1=Low
Stream[3] = option_protocol; Stream[3] = option_protocol;

View File

@ -53,6 +53,8 @@ static void __attribute__((unused)) V761_set_checksum()
static void __attribute__((unused)) V761_send_packet() static void __attribute__((unused)) V761_send_packet()
{ {
static bool calib=false, prev_ch6=false;
if(phase != V761_DATA) if(phase != V761_DATA)
{ {
packet[0] = rx_tx_addr[0]; packet[0] = rx_tx_addr[0];
@ -69,7 +71,7 @@ static void __attribute__((unused)) V761_send_packet()
packet[0] = convert_channel_8b(THROTTLE); // Throttle packet[0] = convert_channel_8b(THROTTLE); // Throttle
packet[2] = convert_channel_8b(ELEVATOR)>>1; // Elevator packet[2] = convert_channel_8b(ELEVATOR)>>1; // Elevator
if(sub_protocol==V761_STD) if(sub_protocol==V761_3CH)
{ {
packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder
packet[3] = convert_channel_8b(AILERON)>>1; // Aileron packet[3] = convert_channel_8b(AILERON)>>1; // Aileron
@ -81,9 +83,8 @@ static void __attribute__((unused)) V761_send_packet()
} }
packet[5] = (packet_count++ / 3)<<6; packet[5] = (packet_count++ / 3)<<6;
packet[4] = (packet[5] == 0x40) ? 0x1a : 0x20; packet[4] = (packet[5] == 0x40) ? 0x1a : 0x20; // ?
// Channel 5 - Gyro mode is packet 5
if(CH5_SW) // Mode Expert Gyro off if(CH5_SW) // Mode Expert Gyro off
flags = 0x0c; flags = 0x0c;
else else
@ -91,14 +92,20 @@ static void __attribute__((unused)) V761_send_packet()
flags = 0x08; // Beginer mode (Gyro on, yaw and pitch rate limited) flags = 0x08; // Beginer mode (Gyro on, yaw and pitch rate limited)
else else
flags = 0x0a; // Mid Mode ( Gyro on no rate limits) flags = 0x0a; // Mid Mode ( Gyro on no rate limits)
if(!prev_ch6 && CH6_SW) // -100% -> 100% launch gyro calib
calib=!calib;
prev_ch6 = CH6_SW;
if(calib)
flags |= 0x01; // Gyro calibration
packet[5] |= flags; packet[5] |= flags;
if(sub_protocol==V761_STD)
packet[6] = 0x80; // unknown packet[6] = GET_FLAG(CH7_SW, 0x20) // Flip
else |GET_FLAG(CH8_SW, 0x08) // RTH activation
{ |GET_FLAG(CH9_SW, 0x10); // RTH on/off
packet[6] = GET_FLAG(CH5_SW, 0x20); // Flip if(sub_protocol==V761_3CH)
// RTH??? packet[6] |= 0x80; // unknown, set on original V761-1 dump but not on eachine dumps, keeping for compatibility
}
//packet counter //packet counter
if(packet_count >= 12) if(packet_count >= 12)
@ -136,22 +143,30 @@ static void __attribute__((unused)) V761_init()
static void __attribute__((unused)) V761_initialize_txid() static void __attribute__((unused)) V761_initialize_txid()
{ {
// TODO: try arbitrary rx_tx_addr & frequencies (except hopping_frequency[0]) switch(RX_num%5)
switch(RX_num%3)
{ {
case 1: //Dump from air on Protonus TX case 1: //Dump from air on Protonus TX
memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4); memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4);
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21\x44",3); memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
break; break;
case 2: //Dump from air on mshagg2 TX case 2: //Dump from air on mshagg2 TX
memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4); memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4);
memcpy(hopping_frequency,(uint8_t *)"\x13\x1D\x4A",3); 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); // To be checked
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2); // To be checked
break;
case 4: //Dump from air on Crashanium Eachine TX
memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4); // To be checked
memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",3); // To be checked
break; break;
default: //Dump from SPI default: //Dump from SPI
memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4); memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4);
memcpy(hopping_frequency,(uint8_t *)"\x14\x1e\x4b",3); memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",3);
break; break;
} }
hopping_frequency[2]=hopping_frequency[0]+0x37;
} }
uint16_t V761_callback() uint16_t V761_callback()
@ -201,10 +216,14 @@ uint16_t V761_callback()
uint16_t initV761(void) uint16_t initV761(void)
{ {
BIND_IN_PROGRESS;
bind_counter = V761_BIND_COUNT;
V761_initialize_txid(); V761_initialize_txid();
phase = V761_BIND1; if(IS_BIND_IN_PROGRESS)
{
bind_counter = V761_BIND_COUNT;
phase = V761_BIND1;
}
else
phase = V761_DATA;
V761_init(); V761_init();
hopping_frequency_no = 0; hopping_frequency_no = 0;
packet_count = 0; packet_count = 0;

View File

@ -715,8 +715,8 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
JXD506 JXD506
V2X2_MR101 V2X2_MR101
PROTO_V761 PROTO_V761
V761_STD V761_3CH
V761_EACHINE V761_4CH
PROTO_V911S PROTO_V911S
V911S_STD V911S_STD
V911S_E119 V911S_E119

View File

@ -1464,25 +1464,27 @@ A|E|T|R|FLIP|LIGHT
## V761 - *48* ## V761 - *48*
Warning: **Only 3 IDs**, you can cycle through them using RX_Num. Warning: **Only 5 IDs**, you can cycle through them using RX_Num.
### Sub_protocol Std - *0*
Model: Volantex V761 and may be other
CH1|CH2|CH3|CH4|CH5
---|---|---|---|---
-|E|T|R|GYRO
Gyro: -100%=Beginer mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off Gyro: -100%=Beginer mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off
Calib: momentary switch, calib will happen one the channel goes from -100% to +100%
Flip: momentary switch: hold flip(+100%), indicate flip direction with Ele or Ail, release flip(-100%)
RTN_ACT and RTN: -100% disable, +100% enable
### Sub_protocol Eachine - *1* ### Sub_protocol 3CH - *0*
Model: Eachine P51-D, F4U, F22 and may be other Model: Volantex V761-1, V761-3 and may be others
CH1|CH2|CH3|CH4|CH5|CH6 CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|--- ---|---|---|---|---|---|---|---|---
A|E|T|R|GYRO|FLIP -|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
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---
A|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
Gyro: -100%=Beginer mode (Gyro on, yaw and pitch rate limited), 0%=Mid Mode ( Gyro on no rate limits), +100%=Mode Expert Gyro off
## V911S - *46* ## V911S - *46*
This protocol is known to be problematic because it's using the xn297L emulation with a transmission speed of 250kbps therefore it doesn't work very well with every modules, this is an hardware issue with the accuracy of the components. This protocol is known to be problematic because it's using the xn297L emulation with a transmission speed of 250kbps therefore it doesn't work very well with every modules, this is an hardware issue with the accuracy of the components.