mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 19:48:11 +00:00
Fix FQ777
This commit is contained in:
parent
b51dedcea1
commit
e5689d2f1b
@ -179,5 +179,5 @@
|
|||||||
78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
|
78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
|
||||||
79,0,WFLY2,RF20x,0,CH5,CH6,CH7,CH8,CH9,CH10
|
79,0,WFLY2,RF20x,0,CH5,CH6,CH7,CH8,CH9,CH10
|
||||||
80,0,E016Hv2,E016Hv2,1,TakLan,EmStop,Flip,Calib,HLess,RTH
|
80,0,E016Hv2,E016Hv2,1,TakLan,EmStop,Flip,Calib,HLess,RTH
|
||||||
81,0,E010r5,E010r5,1,Flip,HLess,RTH
|
81,0,E010r5,E010r5,1,Flip,LED,CALIB,HLess,RTH,UNK
|
||||||
82,0,LOLI,0,CH5,CH6,CH7,CH8
|
82,0,LOLI,0,CH5,CH6,CH7,CH8
|
||||||
|
@ -56,21 +56,20 @@ static void __attribute__((unused)) ssv_pack_dpl(uint8_t addr[], uint8_t pid, ui
|
|||||||
{
|
{
|
||||||
uint8_t bytes[2];
|
uint8_t bytes[2];
|
||||||
uint16_t val;
|
uint16_t val;
|
||||||
} crc;
|
} crca;
|
||||||
|
|
||||||
crc=0x3c18;
|
crc=0x3c18;
|
||||||
for (i = 0; i < 7; ++i)
|
for (i = 0; i < 7; ++i)
|
||||||
crc16_update(header[i],8);
|
crc16_update(header[i],8);
|
||||||
for (i = 0; i < *len; ++i)
|
for (i = 0; i < *len; ++i)
|
||||||
crc16_update(payload[i],8);
|
crc16_update(payload[i],8);
|
||||||
crc.val=crc;
|
|
||||||
|
|
||||||
// encode payload and crc
|
// encode payload and crc
|
||||||
// xor with this:
|
// xor with this:
|
||||||
for (i = 0; i < *len; ++i)
|
for (i = 0; i < *len; ++i)
|
||||||
payload[i] ^= ssv_xor[i];
|
payload[i] ^= ssv_xor[i];
|
||||||
crc.bytes[1] ^= ssv_xor[i++];
|
crc ^= ssv_xor[i++]<<8;
|
||||||
crc.bytes[0] ^= ssv_xor[i++];
|
crc ^= ssv_xor[i++];
|
||||||
|
|
||||||
// pack the pcf, payload, and crc into packed_payload
|
// pack the pcf, payload, and crc into packed_payload
|
||||||
packed_payload[0] = pcf >> 1;
|
packed_payload[0] = pcf >> 1;
|
||||||
@ -79,11 +78,11 @@ static void __attribute__((unused)) ssv_pack_dpl(uint8_t addr[], uint8_t pid, ui
|
|||||||
for (i = 0; i < *len - 1; ++i)
|
for (i = 0; i < *len - 1; ++i)
|
||||||
packed_payload[i+2] = (payload[i] << 7) | (payload[i+1] >> 1);
|
packed_payload[i+2] = (payload[i] << 7) | (payload[i+1] >> 1);
|
||||||
|
|
||||||
packed_payload[i+2] = (payload[i] << 7) | (crc.val >> 9);
|
packed_payload[i+2] = (payload[i] << 7) | (crc >> 9);
|
||||||
++i;
|
++i;
|
||||||
packed_payload[i+2] = (crc.val >> 1 & 0x80 ) | (crc.val >> 1 & 0x7F);
|
packed_payload[i+2] = (crc >> 1 & 0x80 ) | (crc >> 1 & 0x7F);
|
||||||
++i;
|
++i;
|
||||||
packed_payload[i+2] = (crc.val << 7);
|
packed_payload[i+2] = (crc << 7);
|
||||||
|
|
||||||
*len += 4;
|
*len += 4;
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
//******************
|
//******************
|
||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_REVISION 1
|
#define VERSION_REVISION 2
|
||||||
#define VERSION_PATCH_LEVEL 99
|
#define VERSION_PATCH_LEVEL 00
|
||||||
|
|
||||||
//******************
|
//******************
|
||||||
// Protocols
|
// Protocols
|
||||||
|
Loading…
x
Reference in New Issue
Block a user