mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 16:38:12 +00:00
M-Link Failsafe
This commit is contained in:
parent
be1591c489
commit
17750e774a
@ -156,45 +156,84 @@ static void __attribute__((unused)) MLINK_send_bind_packet()
|
||||
static void __attribute__((unused)) MLINK_send_data_packet()
|
||||
{
|
||||
static uint8_t tog=0;
|
||||
if(hopping_frequency_no==0)
|
||||
tog=1;
|
||||
//Channels to be sent
|
||||
if(phase==MLINK_SEND1 || ((hopping_frequency_no%5==0) && (phase==MLINK_SEND2)))
|
||||
uint8_t start;
|
||||
|
||||
#ifdef FAILSAFE_ENABLE
|
||||
static uint8_t fs=0;
|
||||
if(IS_FAILSAFE_VALUES_on && phase==MLINK_SEND1)
|
||||
{
|
||||
if((hopping_frequency_no&1)==0)
|
||||
packet[0] = 0x09; //10,8,6
|
||||
else
|
||||
packet[0] = 0x01; //11,9,7
|
||||
fs=10; // Original radio is sending 70 packets
|
||||
FAILSAFE_VALUES_off;
|
||||
}
|
||||
if(fs)
|
||||
{// Failsafe packets
|
||||
switch(phase)
|
||||
{
|
||||
case MLINK_SEND2:
|
||||
packet[0]=0x06;
|
||||
start=17;
|
||||
break;
|
||||
case MLINK_SEND3:
|
||||
packet[0]=0x84;
|
||||
start=5;
|
||||
fs--;
|
||||
break;
|
||||
default: //MLINK_SEND1:
|
||||
packet[0]=0x05;
|
||||
start=11;
|
||||
break;
|
||||
}
|
||||
//Pack 6 channels per packet
|
||||
for(uint8_t i=0;i<6;i++)
|
||||
{
|
||||
uint8_t val=start<16 ? convert_channel_16b_nolimit(start,426 >> 4,3448 >> 4,true) : 0x00;
|
||||
start--; // switch to next channel
|
||||
packet[i+1]=val;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(phase==MLINK_SEND2)
|
||||
#endif
|
||||
{// Normal packets
|
||||
if(hopping_frequency_no==0)
|
||||
tog=1;
|
||||
//Channels to be sent
|
||||
if(phase==MLINK_SEND1 || ((hopping_frequency_no%5==0) && (phase==MLINK_SEND2)))
|
||||
{
|
||||
if(tog)
|
||||
packet[0] = 0x02; //x,15,13
|
||||
if((hopping_frequency_no&1)==0)
|
||||
packet[0] = 0x09; //10,8,6
|
||||
else
|
||||
packet[0] = 0x0A; //x,14,12
|
||||
tog^=1;
|
||||
packet[0] = 0x01; //11,9,7
|
||||
}
|
||||
else
|
||||
{//phase==MLINK_SEND3
|
||||
if((hopping_frequency_no&1)==0)
|
||||
packet[0] = 0x88; //4,2,0
|
||||
if(phase==MLINK_SEND2)
|
||||
{
|
||||
if(tog)
|
||||
packet[0] = 0x02; //x,15,13
|
||||
else
|
||||
packet[0] = 0x0A; //x,14,12
|
||||
tog^=1;
|
||||
}
|
||||
else
|
||||
packet[0] = 0x80; //5,3,1
|
||||
}
|
||||
{//phase==MLINK_SEND3
|
||||
if((hopping_frequency_no&1)==0)
|
||||
packet[0] = 0x88; //4,2,0
|
||||
else
|
||||
packet[0] = 0x80; //5,3,1
|
||||
}
|
||||
|
||||
//Start channel
|
||||
uint8_t ch=4+6*(packet[0]&3);
|
||||
if((packet[0]&0x08)==0)
|
||||
ch++;
|
||||
|
||||
//Channels 426..1937..3448
|
||||
for(uint8_t i=0;i<3;i++)
|
||||
{
|
||||
uint16_t tmp=ch<16 ? convert_channel_16b_nolimit(ch,426,3448,false) : 0x0000;
|
||||
ch-=2; // switch to next channel
|
||||
packet[i*2+1]=tmp>>8;
|
||||
packet[i*2+2]=tmp;
|
||||
//Start channel
|
||||
start=4+6*(packet[0]&3);
|
||||
if((packet[0]&0x08)==0)
|
||||
start++;
|
||||
|
||||
//Channels 426..1937..3448
|
||||
for(uint8_t i=0;i<3;i++)
|
||||
{
|
||||
uint16_t val=start<16 ? convert_channel_16b_nolimit(start,426,3448,false) : 0x0000;
|
||||
start-=2; // switch to next channel
|
||||
packet[i*2+1]=val>>8;
|
||||
packet[i*2+2]=val;
|
||||
}
|
||||
}
|
||||
|
||||
//Calculate CRC
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_REVISION 2
|
||||
#define VERSION_PATCH_LEVEL 28
|
||||
#define VERSION_PATCH_LEVEL 29
|
||||
|
||||
//******************
|
||||
// Protocols
|
||||
@ -467,7 +467,7 @@ enum MultiPacketTypes
|
||||
//***************
|
||||
//*** Tests ***
|
||||
//***************
|
||||
#define IS_FAILSAFE_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_FUTABA || protocol==PROTO_WK2x01 || protocol== PROTO_HOTT || protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 || protocol==PROTO_FRSKY_R9 || protocol==PROTO_WFLY2 || protocol==PROTO_LOLI)
|
||||
#define IS_FAILSAFE_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_FUTABA || protocol==PROTO_WK2x01 || protocol== PROTO_HOTT || protocol==PROTO_FRSKYX || protocol==PROTO_FRSKYX2 || protocol==PROTO_FRSKY_R9 || protocol==PROTO_WFLY2 || protocol==PROTO_LOLI || protocol==PROTO_MLINK)
|
||||
#define IS_CHMAP_PROTOCOL ( (protocol==PROTO_HISKY && sub_protocol==HK310) || protocol==PROTO_AFHDS2A || protocol==PROTO_DEVO || protocol==PROTO_FUTABA || protocol==PROTO_WK2x01 || protocol== PROTO_DSM || protocol==PROTO_SLT || protocol==PROTO_FLYSKY || (protocol==PROTO_KYOSHO && sub_protocol==KYOSHO_HYPE) || protocol==PROTO_ESKY || protocol==PROTO_J6PRO || protocol==PROTO_PELIKAN || protocol==PROTO_SKYARTEC || protocol==PROTO_ESKY150V2 || protocol==PROTO_DSM_RX)
|
||||
|
||||
//***************
|
||||
|
@ -113,7 +113,7 @@ CFlie|38|CFlie||||||||NRF24L01|
|
||||
[Kyosho](Protocols_Details.md#Kyosho---73)|73|FHSS|Hype|||||||A7105|
|
||||
[LOLI](Protocols_Details.md#LOLI---82)|82|||||||||NRF24L01|
|
||||
[MJXq](Protocols_Details.md#MJXQ---18)|18|WLH08|X600|X800|H26D|E010*|H26WH|PHOENIX*||NRF24L01|XN297
|
||||
[MLINK](Protocols_Details.md#MLINK---78)|78|Slow||||||||CYRF6936|
|
||||
[MLINK](Protocols_Details.md#MLINK---78)|78|||||||||CYRF6936|
|
||||
[MT99xx](Protocols_Details.md#MT99XX---17)|17|MT|H7|YZ|LS|FY805||||NRF24L01|XN297
|
||||
[NCC1701](Protocols_Details.md#NCC1701---44)|44|NCC1701||||||||NRF24L01|
|
||||
[OMP](Protocols_Details.md#OMP---77)|77|||||||||CC2500&NRF24L01|XN297L
|
||||
@ -866,9 +866,9 @@ A|E|T|R|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12
|
||||
## MLINK - *78*
|
||||
Extended limits supported
|
||||
|
||||
Telemetry: the 2 RXs I have are sending different information in different format, I've done something which might work or not so please report
|
||||
**Failsafe MUST be configured once with the desired channel values (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!!!**
|
||||
|
||||
### Sub_protocol Slow - *0*
|
||||
Telemetry: the 2 RXs I have are sending different information in different format, I've done something which might work or not so please report
|
||||
|
||||
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9|CH10|CH11|CH12|CH13|CH14|CH15|CH16
|
||||
---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----
|
||||
|
Loading…
x
Reference in New Issue
Block a user