mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-01 18:27:53 +00:00
Devo fix
This commit is contained in:
parent
e7ed80d3e0
commit
840a583a0b
@ -78,7 +78,12 @@ static void __attribute__((unused)) DEVO_scramble_pkt()
|
||||
static void __attribute__((unused)) DEVO_add_pkt_suffix()
|
||||
{
|
||||
uint8_t bind_state;
|
||||
if (option)
|
||||
if(prev_option!=option)
|
||||
{
|
||||
MProtocol_id = RX_num + MProtocol_id_master;
|
||||
bind_counter=DEVO_BIND_COUNT;
|
||||
}
|
||||
if (option)
|
||||
{
|
||||
if (bind_counter > 0)
|
||||
bind_state = 0xc0;
|
||||
@ -90,9 +95,9 @@ static void __attribute__((unused)) DEVO_add_pkt_suffix()
|
||||
packet[10] = bind_state | (DEVO_PKTS_PER_CHANNEL - packet_count - 1);
|
||||
packet[11] = *(hopping_frequency_ptr + 1);
|
||||
packet[12] = *(hopping_frequency_ptr + 2);
|
||||
packet[13] = fixed_id & 0xff;
|
||||
packet[14] = (fixed_id >> 8) & 0xff;
|
||||
packet[15] = (fixed_id >> 16) & 0xff;
|
||||
packet[13] = MProtocol_id & 0xff;
|
||||
packet[14] = (MProtocol_id >> 8) & 0xff;
|
||||
packet[15] = (MProtocol_id >> 16) & 0xff;
|
||||
}
|
||||
|
||||
static void __attribute__((unused)) DEVO_build_beacon_pkt(uint8_t upper)
|
||||
@ -303,11 +308,13 @@ uint16_t DevoInit()
|
||||
|
||||
packet_count = 0;
|
||||
|
||||
prev_option=option;
|
||||
if(option==0)
|
||||
{
|
||||
MProtocol_id = ((uint32_t)(hopping_frequency[0] ^ cyrfmfg_id[0] ^ cyrfmfg_id[3]) << 16)
|
||||
| ((uint32_t)(hopping_frequency[1] ^ cyrfmfg_id[1] ^ cyrfmfg_id[4]) << 8)
|
||||
| ((uint32_t)(hopping_frequency[2] ^ cyrfmfg_id[2] ^ cyrfmfg_id[5]) << 0);
|
||||
MProtocol_id %= 1000000;
|
||||
bind_counter = DEVO_BIND_COUNT;
|
||||
phase = DEVO_BIND;
|
||||
BIND_IN_PROGRESS;
|
||||
@ -318,12 +325,6 @@ uint16_t DevoInit()
|
||||
bind_counter = 0;
|
||||
DEVO_cyrf_set_bound_sop_code();
|
||||
}
|
||||
MProtocol_id %= 1000000;
|
||||
|
||||
if(IS_AUTOBIND_FLAG_on)
|
||||
{
|
||||
bind_counter = DEVO_BIND_COUNT;
|
||||
}
|
||||
return 2400;
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,6 @@
|
||||
//Global constants/variables
|
||||
uint32_t MProtocol_id;//tx id,
|
||||
uint32_t MProtocol_id_master;
|
||||
uint32_t Model_fixed_id=0;
|
||||
uint32_t fixed_id;
|
||||
uint8_t cyrfmfg_id[6];//for dsm2 and devo
|
||||
uint32_t blink=0;
|
||||
uint8_t prev_option;
|
||||
uint8_t prev_power=0xFD; // unused power value
|
||||
@ -51,6 +48,7 @@ uint8_t Servo_AUX;
|
||||
uint16_t servo_max_100,servo_min_100,servo_max_125,servo_min_125;
|
||||
|
||||
// Protocol variables
|
||||
uint8_t cyrfmfg_id[6];//for dsm2 and devo
|
||||
uint8_t rx_tx_addr[5];
|
||||
uint8_t phase;
|
||||
uint16_t bind_counter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user