Send channel order in MULTI_TELEMETRY

This commit is contained in:
pascallanger 2019-10-09 11:58:50 +02:00
parent 0b19fa0bdf
commit 5c7f997e7a
3 changed files with 20 additions and 17 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 10 #define VERSION_PATCH_LEVEL 11
//****************** //******************
// Protocols // Protocols
@ -829,13 +829,13 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
Values are concatenated to fit in 22 bytes like in SBUS protocol. 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 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. 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) sub_protocol is 0..255 (bits 0..5 + bits 6..7)
RxNum value is 0..63 (bits 0..3 + bits 4..5) RxNum value is 0..63 (bits 0..3 + bits 4..5)
Disable_Telemetry => 0x08 0=enable, 1=disable Telemetry_Invert => 0x08 0=normal, 1=invert
Disable_CH_Mapping => 0x04 0=enable, 1=disable Future_Use => 0x04 0= , 1=
Future_Use => 0x02 0= , 1= Disable_Telemetry => 0x02 0=enable, 1=disable
Telem_Invert => 0x01 0=normal, 1=invert Disable_CH_Mapping => 0x01 0=enable, 1=disable
Stream[27.. 36] = between 0 and 9 bytes for additional protocol data 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 0x08 = Module is in binding mode
0x10 = Module waits a bind event to load the protocol 0x10 = Module waits a bind event to load the protocol
0x20 = Current protocol supports failsafe 0x20 = Current protocol supports failsafe
0x40 = Current protocol supports disable channel mapping
0x80 = Data buffer is almost full 0x80 = Data buffer is almost full
[5] major [5] major
[6] minor [6] minor
[7] revision [7] revision
[8] patchlevel, [8] patchlevel
version of multi code, should be displayed as major.minor.revision.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 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 0x02 Frksy S.port telemetry
Type 0x03 Frsky Hub telemetry Type 0x03 Frsky Hub telemetry

View File

@ -1493,14 +1493,14 @@ void update_serial_data()
if(rx_len>26) if(rx_len>26)
{//Additional flag received at the end {//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] 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; DISABLE_TELEM_on;
if(rx_ok_buff[26]&0x04) if(rx_ok_buff[26]&0x01)
DISABLE_CH_MAP_on; DISABLE_CH_MAP_on;
#if defined TELEMETRY #if defined TELEMETRY
if((rx_ok_buff[26]&0x01) ^ prev_inv_telem) if(((rx_ok_buff[26]&0x08)!=0) ^ prev_inv_telem)
{ //value changed { //value changed
if(rx_ok_buff[26]&0x01) if(rx_ok_buff[26]&0x08)
{ // Invert telemetry { // Invert telemetry
debugln("Invert telem %d,%d",rx_ok_buff[26]&0x01,prev_inv_telem); debugln("Invert telem %d,%d",rx_ok_buff[26]&0x01,prev_inv_telem);
#ifdef ORANGE_TX #ifdef ORANGE_TX
@ -1512,7 +1512,7 @@ void update_serial_data()
#endif #endif
} }
else else
{ // Normal telemetry { // Normal telemetry
debugln("Normal telem %d,%d",rx_ok_buff[26]&0x01,prev_inv_telem); debugln("Normal telem %d,%d",rx_ok_buff[26]&0x01,prev_inv_telem);
#ifdef ORANGE_TX #ifdef ORANGE_TX
PORTC.PIN3CTRL &= 0xBF ; PORTC.PIN3CTRL &= 0xBF ;
@ -1522,7 +1522,7 @@ void update_serial_data()
RX_INV_off; RX_INV_off;
#endif #endif
} }
prev_inv_telem=rx_ok_buff[26]&0x01; prev_inv_telem=rx_ok_buff[26]&0x08;
} }
#endif #endif
} }

View File

@ -78,7 +78,7 @@ static void multi_send_header(uint8_t type, uint8_t len)
static void multi_send_status() static void multi_send_status()
{ {
multi_send_header(MULTI_TELEMETRY_STATUS, 5); multi_send_header(MULTI_TELEMETRY_STATUS, 6);
// Build flags // Build flags
uint8_t flags=0; uint8_t flags=0;
@ -129,6 +129,9 @@ static void multi_send_status()
Serial_write(VERSION_MINOR); Serial_write(VERSION_MINOR);
Serial_write(VERSION_REVISION); Serial_write(VERSION_REVISION);
Serial_write(VERSION_PATCH_LEVEL); Serial_write(VERSION_PATCH_LEVEL);
// Channel order
Serial_write(RUDDER<<6|THROTTLE<<4|ELEVATOR<<2|AILERON);
} }
#endif #endif