Fix DSM invalid protocol when binding

This commit is contained in:
pascallanger 2020-01-12 18:18:47 +01:00
parent 8f789607e4
commit 7f3c80c2a9
2 changed files with 3 additions and 2 deletions

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 0 #define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 54 #define VERSION_PATCH_LEVEL 55
//****************** //******************
// Protocols // Protocols

View File

@ -144,6 +144,7 @@ static void multi_send_status()
if((sub_protocol&0x07) && multi_protocols_index != 0xFF) if((sub_protocol&0x07) && multi_protocols_index != 0xFF)
{ {
uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto; uint8_t nbr=multi_protocols[multi_protocols_index].nbrSubProto;
if(protocol==PROTO_DSM) nbr++; //Auto sub_protocol
if((sub_protocol&0x07)>=nbr) if((sub_protocol&0x07)>=nbr)
flags &= ~0x04; //Invalid sub protocol flags &= ~0x04; //Invalid sub protocol
} }
@ -163,7 +164,7 @@ static void multi_send_status()
flags |= 0x80; flags |= 0x80;
} }
Serial_write(flags); Serial_write(flags);
// Version number example: 1.1.6.1 // Version number example: 1.1.6.1
Serial_write(VERSION_MAJOR); Serial_write(VERSION_MAJOR);
Serial_write(VERSION_MINOR); Serial_write(VERSION_MINOR);