WFLY: Failsafe values

This commit is contained in:
Pascal Langer 2021-02-24 16:29:24 +01:00
parent 08ea8818fb
commit f19bb05c7a
4 changed files with 24 additions and 15 deletions

View File

@ -403,7 +403,7 @@ const mm_protocol_definition multi_protocols[] = {
{PROTO_WK2x01, STR_WK2x01, STR_SUBTYPE_WK2x01, 6, OPTION_NONE, 1, 1, SW_CYRF, WK_init, WK_callback },
#endif
#if defined(WFLY_CYRF6936_INO)
{PROTO_WFLY, STR_WFLY, STR_SUBTYPE_WFLY, 1, OPTION_NONE, 0, 0, SW_CYRF, WFLY_init, WFLY_callback },
{PROTO_WFLY, STR_WFLY, STR_SUBTYPE_WFLY, 1, OPTION_NONE, 1, 0, SW_CYRF, WFLY_init, WFLY_callback },
#endif
#if defined(WFLY2_A7105_INO)
{PROTO_WFLY2, STR_WFLY2, STR_SUBTYPE_WFLY2, 1, OPTION_OPTION, 1, 0, SW_A7105, WFLY2_init, WFLY2_callback },

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 2
#define VERSION_PATCH_LEVEL 50
#define VERSION_PATCH_LEVEL 51
//******************
// Protocols

View File

@ -105,28 +105,35 @@ static uint16_t __attribute__((unused)) WFLY_send_data_packet()
len=4;
for(uint8_t i=0;i<3;i++)
{ // Channels
uint16_t ch = convert_channel_16b_nolimit(i*4+0,151,847,false);
uint16_t ch = convert_channel_16b_nolimit(i*4+0,151,847,IS_FAILSAFE_VALUES_on);
uint8_t offset=i*5;
packet[3+offset]|=ch<<6;
packet[4+offset]=ch>>2;
packet[3+offset] |= ch<<6;
packet[4+offset] = ch>>2;
len++;
if(--nbr_ch==0) break;
ch = convert_channel_16b_nolimit(i*4+1,151,847,false);
packet[5+offset]=ch;
packet[6+offset]=ch>>8;
ch = convert_channel_16b_nolimit(i*4+1,151,847,IS_FAILSAFE_VALUES_on);
packet[5+offset] = ch;
packet[6+offset] = ch>>8;
len+=2;
if(--nbr_ch==0) break;
ch = convert_channel_16b_nolimit(i*4+2,151,847,false);
packet[6+offset]|=ch<<2;
packet[7+offset]=ch>>6;
ch = convert_channel_16b_nolimit(i*4+2,151,847,IS_FAILSAFE_VALUES_on);
packet[6+offset] |= ch<<2;
packet[7+offset] = ch>>6;
len++;
if(--nbr_ch==0) break;
ch = convert_channel_16b_nolimit(i*4+3,151,847,false);
packet[7+offset]|=ch<<4;
packet[8+offset]=ch>>4;
ch = convert_channel_16b_nolimit(i*4+3,151,847,IS_FAILSAFE_VALUES_on);
packet[7+offset] |= ch<<4;
packet[8+offset] = ch>>4;
len++;
if(--nbr_ch==0) break;
}
#ifdef FAILSAFE_ENABLE
if(IS_FAILSAFE_VALUES_on)
{
packet[2] |= 0x10; // 19 times 3 times 0x10 followed by 3 times 0x18 and so on but 1 time 0x10 seems to be enough for the RX to learn
FAILSAFE_VALUES_off;
}
#endif
}
uint8_t sum=0;

View File

@ -567,7 +567,9 @@ Receivers: WFR04S, WFR07S, WFR09S
Extended limits supported
option=number of channels from 4 to 9. An invalid option value will end up sending 9 channels.
Failsafe values supported (not hold or none)
Option=number of channels from 4 to 9. An invalid option value will end up sending 9 channels.
CH1|CH2|CH3|CH4|CH5|CH6|CH7|CH8|CH9
---|---|---|---|---|---|---|---|---