diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 26c4430..d46547d 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 0 -#define VERSION_PATCH_LEVEL 10 +#define VERSION_PATCH_LEVEL 11 //****************** // Protocols @@ -829,13 +829,13 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- Values are concatenated to fit in 22 bytes like in SBUS protocol. Failsafe values have exactly the same range/values than normal channels except the extremes where 0=no pulse, 2047=hold. If failsafe is not set or RX then failsafe packets should not be sent. - Stream[26] = sub_protocol bits 6 & 7|RxNum bits 4 & 5|Disable_Telemetry 3|Disable_CH_Mapping 2|Future_Use 1|Telem_Invert 0; + Stream[26] = sub_protocol bits 6 & 7|RxNum bits 4 & 5|Future_Use 3|Telem_Invert 2|Disable_Telemetry 1|Disable_CH_Mapping 0 sub_protocol is 0..255 (bits 0..5 + bits 6..7) RxNum value is 0..63 (bits 0..3 + bits 4..5) - Disable_Telemetry => 0x08 0=enable, 1=disable - Disable_CH_Mapping => 0x04 0=enable, 1=disable - Future_Use => 0x02 0= , 1= - Telem_Invert => 0x01 0=normal, 1=invert + Telemetry_Invert => 0x08 0=normal, 1=invert + Future_Use => 0x04 0= , 1= + Disable_Telemetry => 0x02 0=enable, 1=disable + Disable_CH_Mapping => 0x01 0=enable, 1=disable Stream[27.. 36] = between 0 and 9 bytes for additional protocol data */ /* @@ -896,16 +896,16 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p -- 0x08 = Module is in binding mode 0x10 = Module waits a bind event to load the protocol 0x20 = Current protocol supports failsafe + 0x40 = Current protocol supports disable channel mapping 0x80 = Data buffer is almost full [5] major [6] minor [7] revision - [8] patchlevel, - version of multi code, should be displayed as major.minor.revision.patchlevel - + [8] patchlevel + version of multi code, should be displayed as major.minor.revision.patchlevel + [9] channel order: CH4|CH3|CH2|CH1 with CHx value A=0,E=1,T=2,R=3 more information can be added by specifing a longer length of the type, the TX will just ignore these bytes - Type 0x02 Frksy S.port telemetry Type 0x03 Frsky Hub telemetry diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index 8df03c1..4fd1295 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1493,14 +1493,14 @@ void update_serial_data() if(rx_len>26) {//Additional flag received at the end rx_ok_buff[0]=(rx_ok_buff[26]&0xF0) | (rx_ok_buff[0]&0x0F); // Additional protocol numbers and RX_Num available -> store them in rx_ok_buff[0] - if(rx_ok_buff[26]&0x08) + if(rx_ok_buff[26]&0x02) DISABLE_TELEM_on; - if(rx_ok_buff[26]&0x04) + if(rx_ok_buff[26]&0x01) DISABLE_CH_MAP_on; #if defined TELEMETRY - if((rx_ok_buff[26]&0x01) ^ prev_inv_telem) + if(((rx_ok_buff[26]&0x08)!=0) ^ prev_inv_telem) { //value changed - if(rx_ok_buff[26]&0x01) + if(rx_ok_buff[26]&0x08) { // Invert telemetry debugln("Invert telem %d,%d",rx_ok_buff[26]&0x01,prev_inv_telem); #ifdef ORANGE_TX @@ -1512,7 +1512,7 @@ void update_serial_data() #endif } else - { // Normal telemetry + { // Normal telemetry debugln("Normal telem %d,%d",rx_ok_buff[26]&0x01,prev_inv_telem); #ifdef ORANGE_TX PORTC.PIN3CTRL &= 0xBF ; @@ -1522,7 +1522,7 @@ void update_serial_data() RX_INV_off; #endif } - prev_inv_telem=rx_ok_buff[26]&0x01; + prev_inv_telem=rx_ok_buff[26]&0x08; } #endif } diff --git a/Multiprotocol/Telemetry.ino b/Multiprotocol/Telemetry.ino index 5dca7dd..69a42de 100644 --- a/Multiprotocol/Telemetry.ino +++ b/Multiprotocol/Telemetry.ino @@ -78,7 +78,7 @@ static void multi_send_header(uint8_t type, uint8_t len) static void multi_send_status() { - multi_send_header(MULTI_TELEMETRY_STATUS, 5); + multi_send_header(MULTI_TELEMETRY_STATUS, 6); // Build flags uint8_t flags=0; @@ -129,6 +129,9 @@ static void multi_send_status() Serial_write(VERSION_MINOR); Serial_write(VERSION_REVISION); Serial_write(VERSION_PATCH_LEVEL); + + // Channel order + Serial_write(RUDDER<<6|THROTTLE<<4|ELEVATOR<<2|AILERON); } #endif