INVERT_TELEMETRY_TX flag

This commit is contained in:
pascallanger 2019-10-27 17:02:38 +01:00
parent 400fdb3cc6
commit 63d7e32e06
3 changed files with 8 additions and 10 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 24 #define VERSION_PATCH_LEVEL 25
//****************** //******************
// Protocols // Protocols

View File

@ -1463,7 +1463,7 @@ static void protocol_init()
void update_serial_data() void update_serial_data()
{ {
static bool prev_ch_mapping=false; static bool prev_ch_mapping=false;
#ifdef TELEMETRY #if defined(TELEMETRY) && defined(INVERT_TELEMETRY_TX)
#ifdef INVERT_TELEMETRY #ifdef INVERT_TELEMETRY
static bool prev_inv_telem=true; static bool prev_inv_telem=true;
#else #else
@ -1557,16 +1557,15 @@ void update_serial_data()
DISABLE_TELEM_on; DISABLE_TELEM_on;
if(rx_ok_buff[26]&0x01) if(rx_ok_buff[26]&0x01)
DISABLE_CH_MAP_on; DISABLE_CH_MAP_on;
#if defined TELEMETRY #if defined(TELEMETRY) && defined(INVERT_TELEMETRY_TX)
if(((rx_ok_buff[26]&0x08)!=0) ^ prev_inv_telem) if(((rx_ok_buff[26]&0x08)!=0) ^ prev_inv_telem)
{ //value changed { //value changed
if(rx_ok_buff[26]&0x08) 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 #if defined (ORANGE_TX)
PORTC.PIN3CTRL |= 0x40 ; PORTC.PIN3CTRL |= 0x40 ;
#endif #elif defined (STM32_BOARD)
#ifdef STM32_BOARD
TX_INV_on; TX_INV_on;
RX_INV_on; RX_INV_on;
#endif #endif
@ -1574,10 +1573,9 @@ void update_serial_data()
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 #if defined (ORANGE_TX)
PORTC.PIN3CTRL &= 0xBF ; PORTC.PIN3CTRL &= 0xBF ;
#endif #elif defined (STM32_BOARD)
#ifdef STM32_BOARD
TX_INV_off; TX_INV_off;
RX_INV_off; RX_INV_off;
#endif #endif

View File

@ -225,7 +225,7 @@
//FrSkyX specific setting //FrSkyX specific setting
//----------------------- //-----------------------
//EU LBT setting: if commented the TX will not check if a channel is busy before transmitting. //EU LBT setting: if commented the TX will not check if a channel is busy before transmitting.
//#define FRSKYX_LBT #define FRSKYX_LBT
//DSM specific settings //DSM specific settings
//--------------------- //---------------------