From 88343b742451bed187f8a3ae5f6bcebd668c8e09 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Thu, 9 Sep 2021 08:40:09 +0200 Subject: [PATCH] Proto list: fix flags --- Multiprotocol/Multi_Protos.ino | 6 +++--- Multiprotocol/Multiprotocol.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Multiprotocol/Multi_Protos.ino b/Multiprotocol/Multi_Protos.ino index 3074f91..d8d89c3 100644 --- a/Multiprotocol/Multi_Protos.ino +++ b/Multiprotocol/Multi_Protos.ino @@ -476,7 +476,7 @@ uint16_t PROTOLIST_callback() { if(option != prev_option) {//Only send once - /* Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the option field. + /* Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the Option field. length: variable data[0] = protocol number, 0xFF is an invalid list entry (Option value too large), Option == 0xFF -> number of protocols in the list data[1..n] = protocol name null terminated @@ -517,10 +517,10 @@ uint16_t PROTOLIST_callback() //Flags uint8_t flags=0; #ifdef FAILSAFE_ENABLE - if(multi_protocols[multi_protocols_index].failSafe) + if(multi_protocols[option].failSafe) flags |= 0x01; //Failsafe supported #endif - if(multi_protocols[multi_protocols_index].chMap) + if(multi_protocols[option].chMap) flags |= 0x02; //Disable_ch_mapping supported Serial_write( flags | (multi_protocols[option].optionType<<4)); // flags && option type //Number of sub protocols diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 0226dd6..76819a7 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -1292,7 +1292,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- length: 22 data[0..21] = Config data - Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the option field. + Type 0x11 Protocol list export via telemetry. Used by the protocol PROTO_PROTOLIST=0, the list entry is given by the Option field. length: variable data[0] = protocol number, 0xFF is an invalid list entry (Option value too large), Option == 0xFF -> number of protocols in the list data[1..n] = protocol name null terminated