Skip to content

Commit 2bd50f4

Browse files
committed
V761/TOPRC: new sub protocol
Top RC Hobby mini planes
1 parent 4c2ddcb commit 2bd50f4

File tree

6 files changed

+75
-49
lines changed

6 files changed

+75
-49
lines changed

Lua_scripts/MultiChan.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
5,1,V2x2,JXD506,1,Flip,Light,Pict,Video,HLess,StaSto,Emerg,Cam_UD
173173
48,0,V761,3CH,0,Gyro,Calib,Flip,RtnAct,Rtn
174174
48,1,V761,4CH,0,Gyro,Calib,Flip,RtnAct,Rtn
175+
48,2,V761,TOPRC,0,Gyro,Calib,Flip,RtnAct,Rtn
175176
46,0,V911s,V911s,1,Calib,Rate
176177
46,1,V911s,E119,1,Calib,Rate,6G_3D
177178
22,0,WFLY,WFR0xS,0,CH5,CH6,CH7,CH8,CH9

Multiprotocol/Multi.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
45,E01X,E012,E015
4646
46,V911S,V911S,E119
4747
47,GD00x,GD_V1,GD_V2
48-
48,V761,3CH,4CH
48+
48,V761,3CH,4CH,TOPRC
4949
49,KF606,KF606,MIG320
5050
50,Redpine,Fast,Slow
5151
51,Potensic,A20
@@ -89,4 +89,4 @@
8989
90,MouldKg,Analog,Digit
9090
91,Xerall
9191
92,MT99xx,PA18
92-
93,Kyosho2,KT-17
92+
93,Kyosho2,KT-17

Multiprotocol/Multi_Protos.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const char STR_SUBTYPE_WFLY[] = "\x05""WFR0x";
155155
const char STR_SUBTYPE_WFLY2[] = "\x05""RF20x";
156156
const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync";
157157
const char STR_SUBTYPE_PELIKAN[] = "\x05""Pro\0 ""Lite\0""SCX24";
158-
const char STR_SUBTYPE_V761[] = "\x03""3ch""4ch";
158+
const char STR_SUBTYPE_V761[] = "\x05""3ch\0 ""4ch\0 ""TOPRC";
159159
const char STR_SUBTYPE_RLINK[] = "\x07""Surface""Air\0 ""DumboRC";
160160
const char STR_SUBTYPE_REALACC[] = "\x03""R11";
161161
const char STR_SUBTYPE_KYOSHO[] = "\x04""FHSS""Hype";
@@ -442,7 +442,7 @@ const mm_protocol_definition multi_protocols[] = {
442442
{PROTO_V2X2, STR_V2X2, STR_SUBTYPE_V2X2, 3, OPTION_NONE, 0, 0, SW_NRF, V2X2_init, V2X2_callback },
443443
#endif
444444
#if defined(V761_NRF24L01_INO)
445-
{PROTO_V761, STR_V761, STR_SUBTYPE_V761, 2, OPTION_NONE, 0, 0, SW_NRF, V761_init, V761_callback },
445+
{PROTO_V761, STR_V761, STR_SUBTYPE_V761, 3, OPTION_NONE, 0, 0, SW_NRF, V761_init, V761_callback },
446446
#endif
447447
#if defined(V911S_CCNRF_INO)
448448
{PROTO_V911S, STR_V911S, STR_SUBTYPE_V911S, 2, OPTION_RFTUNE, 0, 0, SW_NRF, V911S_init, V911S_callback },

Multiprotocol/Multiprotocol.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define VERSION_MAJOR 1
2020
#define VERSION_MINOR 3
2121
#define VERSION_REVISION 3
22-
#define VERSION_PATCH_LEVEL 19
22+
#define VERSION_PATCH_LEVEL 20
2323

2424
#define MODE_SERIAL 0
2525

@@ -418,6 +418,7 @@ enum V761
418418
{
419419
V761_3CH = 0,
420420
V761_4CH = 1,
421+
V761_TOPRC = 2,
421422
};
422423
enum HEIGHT
423424
{

Multiprotocol/V761_nrf24l01.ino

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ Multiprotocol is distributed in the hope that it will be useful,
2525
#define V761_BIND_COUNT 200
2626
#define V761_BIND_FREQ 0x28
2727
#define V761_RF_NUM_CHANNELS 3
28+
#define TOPRC_BIND_FREQ 0x2A
29+
#define TOPRC_PACKET_PERIOD 14120 // Timeout for callback in uSec
2830

2931
enum
30-
{
32+
{
3133
V761_BIND1 = 0,
3234
V761_BIND2,
3335
V761_DATA
34-
};
36+
};
3537

3638
static void __attribute__((unused)) V761_set_checksum()
3739
{
@@ -56,14 +58,11 @@ static void __attribute__((unused)) V761_send_packet()
5658

5759
if(phase != V761_DATA)
5860
{
59-
packet[0] = rx_tx_addr[0];
60-
packet[1] = rx_tx_addr[1];
61-
packet[2] = rx_tx_addr[2];
62-
packet[3] = rx_tx_addr[3];
61+
memcpy(packet, rx_tx_addr, 4);
6362
packet[4] = hopping_frequency[1];
6463
packet[5] = hopping_frequency[2];
6564
if(phase == V761_BIND2)
66-
packet[6] = 0xf0; // ?
65+
packet[6] = 0xF0; // ?
6766
}
6867
else
6968
{
@@ -72,22 +71,21 @@ static void __attribute__((unused)) V761_send_packet()
7271
{
7372
hopping_frequency_no = 0;
7473
packet_count++;
75-
if(packet_count >= 4)
76-
packet_count = 0;
74+
packet_count &= 0x03;
7775
}
7876

7977
packet[0] = convert_channel_8b(THROTTLE); // Throttle
8078
packet[2] = convert_channel_8b(ELEVATOR)>>1; // Elevator
8179

82-
if(sub_protocol==V761_3CH)
80+
if(sub_protocol == V761_4CH || sub_protocol == V761_TOPRC)
8381
{
84-
packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder
85-
packet[3] = convert_channel_8b(AILERON)>>1; // Aileron
82+
packet[1] = convert_channel_8b(AILERON)>>1; // Aileron
83+
packet[3] = convert_channel_8b(RUDDER)>>1; // Rudder
8684
}
8785
else
8886
{
89-
packet[1] = convert_channel_8b(AILERON)>>1; // Aileron
90-
packet[3] = convert_channel_8b(RUDDER)>>1; // Rudder
87+
packet[1] = convert_channel_8b(RUDDER)>>1; // Rudder
88+
packet[3] = convert_channel_8b(AILERON)>>1; // Aileron
9189
}
9290

9391
packet[5] = packet_count<<6; // 0X, 4X, 8X, CX
@@ -112,7 +110,7 @@ static void __attribute__((unused)) V761_send_packet()
112110
packet[6] = GET_FLAG(CH7_SW, 0x20) // Flip
113111
|GET_FLAG(CH8_SW, 0x08) // RTH activation
114112
|GET_FLAG(CH9_SW, 0x10); // RTH on/off
115-
if(sub_protocol==V761_3CH)
113+
if(sub_protocol == V761_3CH)
116114
packet[6] |= 0x80; // Unknown, set on original V761-1 dump but not on eachine dumps, keeping for compatibility
117115
}
118116
V761_set_checksum();
@@ -137,28 +135,36 @@ static void __attribute__((unused)) V761_RF_init()
137135
static void __attribute__((unused)) V761_initialize_txid()
138136
{
139137
#ifdef V761_FORCE_ID
140-
switch(RX_num%5)
138+
if(sub_protocol == V761_TOPRC)
139+
{ //Dump from air on TopRCHobby TX
140+
memcpy(rx_tx_addr,(uint8_t *)"\xD5\x01\x00\x00",4);
141+
memcpy(hopping_frequency,(uint8_t *)"\x2E\x41",2);
142+
}
143+
else
141144
{
142-
case 1: //Dump from air on Protonus TX
143-
memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4);
144-
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
145-
break;
146-
case 2: //Dump from air on mshagg2 TX
147-
memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4);
148-
memcpy(hopping_frequency,(uint8_t *)"\x13\x1D",2);
149-
break;
150-
case 3: //Dump from air on MikeHRC Eachine TX
151-
memcpy(rx_tx_addr,(uint8_t *)"\x08\x03\x00\xA0",4);
152-
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
153-
break;
154-
case 4: //Dump from air on Crashanium Eachine TX
155-
memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4);
156-
memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",2);
157-
break;
158-
default: //Dump from SPI
159-
memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4);
160-
memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",2);
161-
break;
145+
switch(RX_num%5)
146+
{
147+
case 1: //Dump from air on Protonus TX
148+
memcpy(rx_tx_addr,(uint8_t *)"\xE8\xE4\x45\x09",4);
149+
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
150+
break;
151+
case 2: //Dump from air on mshagg2 TX
152+
memcpy(rx_tx_addr,(uint8_t *)"\xAE\xD1\x45\x09",4);
153+
memcpy(hopping_frequency,(uint8_t *)"\x13\x1D",2);
154+
break;
155+
case 3: //Dump from air on MikeHRC Eachine TX
156+
memcpy(rx_tx_addr,(uint8_t *)"\x08\x03\x00\xA0",4);
157+
memcpy(hopping_frequency,(uint8_t *)"\x0D\x21",2);
158+
break;
159+
case 4: //Dump from air on Crashanium Eachine TX
160+
memcpy(rx_tx_addr,(uint8_t *)"\x58\x08\x00\xA0",4);
161+
memcpy(hopping_frequency,(uint8_t *)"\x0D\x31",2);
162+
break;
163+
default: //Dump from SPI
164+
memcpy(rx_tx_addr,(uint8_t *)"\x6f\x2c\xb1\x93",4);
165+
memcpy(hopping_frequency,(uint8_t *)"\x14\x1e",2);
166+
break;
167+
}
162168
}
163169
#else
164170
//Tested with Eachine RX
@@ -180,8 +186,8 @@ uint16_t V761_callback()
180186
if(bind_counter)
181187
bind_counter--;
182188
packet_count ++;
183-
XN297_RFChannel(V761_BIND_FREQ);
184-
XN297_SetTXAddr((uint8_t*)"\x34\x43\x10\x10", 4);
189+
XN297_RFChannel(sub_protocol == V761_TOPRC ? TOPRC_BIND_FREQ : V761_BIND_FREQ);
190+
XN297_SetTXAddr(rx_id, 4);
185191
V761_send_packet();
186192
if(packet_count >= 20)
187193
{
@@ -210,17 +216,28 @@ uint16_t V761_callback()
210216
return 15730;
211217
case V761_DATA:
212218
#ifdef MULTI_SYNC
213-
telemetry_set_input_sync(V761_PACKET_PERIOD);
219+
telemetry_set_input_sync(packet_period);
214220
#endif
215221
V761_send_packet();
216222
break;
217223
}
218-
return V761_PACKET_PERIOD;
224+
return packet_period;
219225
}
220226

221227
void V761_init(void)
222228
{
223229
V761_initialize_txid();
230+
if(sub_protocol == V761_TOPRC)
231+
{
232+
memcpy(rx_id,(uint8_t*)"\x20\x21\x05\x0A",4);
233+
packet_period = TOPRC_PACKET_PERIOD;
234+
}
235+
else
236+
{
237+
memcpy(rx_id,(uint8_t*)"\x34\x43\x10\x10",4);
238+
packet_period = V761_PACKET_PERIOD;
239+
}
240+
224241
if(IS_BIND_IN_PROGRESS)
225242
{
226243
bind_counter = V761_BIND_COUNT;
@@ -231,7 +248,7 @@ void V761_init(void)
231248
XN297_SetTXAddr(rx_tx_addr, 4);
232249
phase = V761_DATA;
233250
}
234-
251+
235252
V761_RF_init();
236253
hopping_frequency_no = 0;
237254
packet_count = 0;

Protocols_Details.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ CFlie|38|CFlie||||||||NRF24L01|
141141
[Tiger](Protocols_Details.md#Tiger---61)|61|||||||||NRF24L01|XN297
142142
[Traxxas](Protocols_Details.md#Traxxas---43)|43|6519 RX||||||||CYRF6936|
143143
[V2x2](Protocols_Details.md#V2X2---5)|5|V2x2|JXD506|MR101||||||NRF24L01|
144-
[V761](Protocols_Details.md#V761---48)|48|3CH|4CH|||||||NRF24L01|XN297
144+
[V761](Protocols_Details.md#V761---48)|48|3CH|4CH|TOPRC||||||NRF24L01|XN297
145145
[V911S](Protocols_Details.md#V911S---46)|46|V911S*|E119*|||||||NRF24L01|XN297
146146
[WFLY](Protocols_Details.md#WFLY---40)|40|WFR0x||||||||CYRF6936|
147147
[WFLY2](Protocols_Details.md#WFLY2---79)|79|RF20x||||||||A7105|
@@ -1951,14 +1951,21 @@ Flip: momentary switch: hold flip(+100%), indicate flip direction with Ele or Ai
19511951
RTN_ACT and RTN: -100% disable, +100% enable
19521952

19531953
### Sub_protocol 3CH - *0*
1954-
Model: Volantex V761-1, V761-3 and may be others
1954+
Models: Volantex V761-1, V761-3 and may be others
19551955

19561956
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
19571957
---|---|---|---|---|---|---|---|---
19581958
-|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
19591959

19601960
### Sub_protocol 4CH - *1*
1961-
Model: Volantex V761-4+ and Eachine P51-D, F4U, F22 and may be others
1961+
Models: Volantex V761-4+ and Eachine P51-D, F4U, F22 and may be others
1962+
1963+
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
1964+
---|---|---|---|---|---|---|---|---
1965+
A|E|T|R|GYRO|CALIB|FLIP|RTN_ACT|RTN
1966+
1967+
### Sub_protocol TOPRC - *2*
1968+
Models: Top RC Hobby Spitfire, P51D, BF-109
19621969

19631970
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
19641971
---|---|---|---|---|---|---|---|---

0 commit comments

Comments
 (0)