Removed depreciated MULTI_STATUS

This commit is contained in:
Pascal Langer 2021-02-08 09:36:47 +01:00
parent fc978f95ef
commit d496f62719
6 changed files with 139 additions and 238 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 2 #define VERSION_REVISION 2
#define VERSION_PATCH_LEVEL 31 #define VERSION_PATCH_LEVEL 32
//****************** //******************
// Protocols // Protocols
@ -1086,35 +1086,8 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
DSM: Stream[27..33] Forward Programming DSM: Stream[27..33] Forward Programming
*/ */
/* /*
Multimodule Status Multiprotocol telemetry/command definition for OpenTX and erskyTX
Based on #define MULTI_STATUS Based on #define MULTI_TELEMETRY enables OpenTX and erskyTX to get the multimodule status and select the correct telemetry type automatically.
Serial: 100000 Baud 8e2 (same as input)
Format: header (2 bytes) + data (variable)
[0] = 'M' (0x4d)
[1] Length (excluding the 2 header bytes)
[2-xx] data
Type = 0x01 Multimodule Status:
[2] Flags
0x01 = Input signal detected
0x02 = Serial mode enabled
0x04 = Protocol is valid
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
[3] major
[4] minor
[5] revision
[6] patchlevel,
version of multi code, should be displayed as major.minor.revision.patchlevel
*/
/*
Multiprotocol telemetry/command definition for OpenTX
Based on #define MULTI_TELEMETRY enables OpenTX to get the multimodule status and select the correct telemetry type automatically.
Serial: 100000 Baud 8e2 (same as input) Serial: 100000 Baud 8e2 (same as input)

View File

@ -839,7 +839,7 @@ bool Update_All()
#endif //ENABLE_PPM #endif //ENABLE_PPM
update_led_status(); update_led_status();
#if defined(TELEMETRY) #if defined(TELEMETRY)
#if ( !( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) ) #ifndef MULTI_TELEMETRY
if((protocol == PROTO_BAYANG_RX) || (protocol == PROTO_AFHDS2A_RX) || (protocol == PROTO_FRSKY_RX) || (protocol == PROTO_SCANNER) || (protocol==PROTO_FRSKYD) || (protocol==PROTO_BAYANG) || (protocol==PROTO_NCC1701) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_FRSKYX2) || (protocol==PROTO_DSM) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_HOTT) || (protocol==PROTO_PROPEL) || (protocol==PROTO_OMP) || (protocol==PROTO_DEVO) || (protocol==PROTO_DSM_RX) || (protocol==PROTO_FRSKY_R9) || (protocol==PROTO_RLINK) || (protocol==PROTO_WFLY2) || (protocol==PROTO_LOLI) || (protocol==PROTO_MLINK)) if((protocol == PROTO_BAYANG_RX) || (protocol == PROTO_AFHDS2A_RX) || (protocol == PROTO_FRSKY_RX) || (protocol == PROTO_SCANNER) || (protocol==PROTO_FRSKYD) || (protocol==PROTO_BAYANG) || (protocol==PROTO_NCC1701) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_FRSKYX2) || (protocol==PROTO_DSM) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_HOTT) || (protocol==PROTO_PROPEL) || (protocol==PROTO_OMP) || (protocol==PROTO_DEVO) || (protocol==PROTO_DSM_RX) || (protocol==PROTO_FRSKY_R9) || (protocol==PROTO_RLINK) || (protocol==PROTO_WFLY2) || (protocol==PROTO_LOLI) || (protocol==PROTO_MLINK))
#endif #endif
if(IS_DISABLE_TELEM_off) if(IS_DISABLE_TELEM_off)

View File

@ -19,7 +19,7 @@
uint8_t RetrySequence ; uint8_t RetrySequence ;
#if ( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) #ifdef MULTI_TELEMETRY
uint32_t lastMulti = 0; uint32_t lastMulti = 0;
#define MULTI_TIME 500 //in ms #define MULTI_TIME 500 //in ms
#ifdef MULTI_SYNC #ifdef MULTI_SYNC
@ -28,7 +28,7 @@ uint8_t RetrySequence ;
uint32_t lastInputSync = 0; uint32_t lastInputSync = 0;
uint16_t inputDelay = 0; uint16_t inputDelay = 0;
#endif // MULTI_SYNC #endif // MULTI_SYNC
#endif // MULTI_TELEMETRY/MULTI_STATUS #endif // MULTI_TELEMETRY
#if defined SPORT_TELEMETRY #if defined SPORT_TELEMETRY
#define FRSKY_SPORT_PACKET_SIZE 8 #define FRSKY_SPORT_PACKET_SIZE 8
@ -62,16 +62,12 @@ uint8_t RetrySequence ;
uint8_t pktx[MAX_PKTX]; uint8_t pktx[MAX_PKTX];
uint8_t frame[18]; uint8_t frame[18];
#if ( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) #ifdef MULTI_TELEMETRY
static void multi_send_header(uint8_t type, uint8_t len) static void multi_send_header(uint8_t type, uint8_t len)
{ {
Serial_write('M'); Serial_write('M');
#ifdef MULTI_TELEMETRY
Serial_write('P'); Serial_write('P');
Serial_write(type); Serial_write(type);
#else
(void)type;
#endif
Serial_write(len); Serial_write(len);
} }
@ -119,15 +115,7 @@ static void telemetry_set_input_sync(uint16_t refreshRate)
static void multi_send_status() static void multi_send_status()
{ {
#ifdef MULTI_TELEMETRY
#ifdef MULTI_NAMES
multi_send_header(MULTI_TELEMETRY_STATUS, 24); multi_send_header(MULTI_TELEMETRY_STATUS, 24);
#else
multi_send_header(MULTI_TELEMETRY_STATUS, 5);
#endif
#else
multi_send_header(MULTI_TELEMETRY_STATUS, 5);
#endif
// Build flags // Build flags
uint8_t flags=0; uint8_t flags=0;
@ -138,7 +126,6 @@ static void multi_send_status()
if (remote_callback != 0) if (remote_callback != 0)
{ {
flags |= 0x04; flags |= 0x04;
#ifdef MULTI_NAMES
if(multi_protocols_index == 0xFF) if(multi_protocols_index == 0xFF)
{ {
if(protocol!=PROTO_SCANNER) if(protocol!=PROTO_SCANNER)
@ -151,10 +138,6 @@ static void multi_send_status()
if((sub_protocol&0x07)>=nbr) if((sub_protocol&0x07)>=nbr)
flags &= ~0x04; //Invalid sub protocol flags &= ~0x04; //Invalid sub protocol
} }
#else
if(remote_callback==0)
flags &= ~0x04; //Invalid protocol
#endif
if (IS_WAIT_BIND_on) if (IS_WAIT_BIND_on)
flags |= 0x10; flags |= 0x10;
else else
@ -177,12 +160,9 @@ static void multi_send_status()
Serial_write(VERSION_REVISION); Serial_write(VERSION_REVISION);
Serial_write(VERSION_PATCH_LEVEL); Serial_write(VERSION_PATCH_LEVEL);
#ifdef MULTI_TELEMETRY
// Channel order // Channel order
Serial_write(RUDDER<<6|THROTTLE<<4|ELEVATOR<<2|AILERON); Serial_write(RUDDER<<6|THROTTLE<<4|ELEVATOR<<2|AILERON);
#endif
#ifdef MULTI_NAMES
if(multi_protocols_index == 0xFF) // selection out of list... send first available protocol if(multi_protocols_index == 0xFF) // selection out of list... send first available protocol
{ {
Serial_write(multi_protocols[0].protocol); // begining of list Serial_write(multi_protocols[0].protocol); // begining of list
@ -218,14 +198,9 @@ static void multi_send_status()
for(;j<8;j++) for(;j<8;j++)
Serial_write(0x00); Serial_write(0x00);
} }
// Channels function
//TODO
#endif
} }
#endif
#ifdef DSM_TELEMETRY #ifdef DSM_TELEMETRY
#ifdef MULTI_TELEMETRY
void DSM_frame() void DSM_frame()
{ {
if (packet_in[0] == 0x80) if (packet_in[0] == 0x80)
@ -242,24 +217,12 @@ static void multi_send_status()
Serial_write(packet_in[i]); Serial_write(packet_in[i]);
} }
} }
#else
void DSM_frame()
{
Serial_write(0xAA); // Telemetry packet
for (uint8_t i = 0; i < 17; i++) // RSSI value followed by 16 bytes of telemetry data
Serial_write(packet_in[i]);
}
#endif
#endif #endif
#ifdef SCANNER_TELEMETRY #ifdef SCANNER_TELEMETRY
void spectrum_scanner_frame() void spectrum_scanner_frame()
{ {
#if defined MULTI_TELEMETRY
multi_send_header(MULTI_TELEMETRY_SCANNER, SCAN_CHANS_PER_PACKET + 1); multi_send_header(MULTI_TELEMETRY_SCANNER, SCAN_CHANS_PER_PACKET + 1);
#else
Serial_write(0xAA); // Telemetry packet
#endif
Serial_write(packet_in[0]); // start channel Serial_write(packet_in[0]); // start channel
for(uint8_t ch = 0; ch < SCAN_CHANS_PER_PACKET; ch++) for(uint8_t ch = 0; ch < SCAN_CHANS_PER_PACKET; ch++)
Serial_write(packet_in[ch+1]); // RSSI power levels Serial_write(packet_in[ch+1]); // RSSI power levels
@ -274,11 +237,7 @@ static void multi_send_status()
len = 4 + (len / 8); len = 4 + (len / 8);
else else
len = 5 + (len / 8); len = 5 + (len / 8);
#if defined MULTI_TELEMETRY
multi_send_header(MULTI_TELEMETRY_RX_CHANNELS, len); multi_send_header(MULTI_TELEMETRY_RX_CHANNELS, len);
#else
Serial_write(0xAA); // Telemetry packet
#endif
for (uint8_t i = 0; i < len; i++) for (uint8_t i = 0; i < len; i++)
Serial_write(packet_in[i]); // pps, rssi, ch start, ch count, 16x ch data Serial_write(packet_in[i]); // pps, rssi, ch start, ch count, 16x ch data
} }
@ -287,11 +246,7 @@ static void multi_send_status()
#ifdef AFHDS2A_FW_TELEMETRY #ifdef AFHDS2A_FW_TELEMETRY
void AFHDSA_short_frame() void AFHDSA_short_frame()
{ {
#if defined MULTI_TELEMETRY
multi_send_header(packet_in[29]==0xAA?MULTI_TELEMETRY_AFHDS2A:MULTI_TELEMETRY_AFHDS2A_AC, 29); multi_send_header(packet_in[29]==0xAA?MULTI_TELEMETRY_AFHDS2A:MULTI_TELEMETRY_AFHDS2A_AC, 29);
#else
Serial_write(packet_in[29]); // Telemetry packet 0xAA or 0xAC
#endif
for (uint8_t i = 0; i < 29; i++) // RSSI value followed by 4*7 bytes of telemetry data for (uint8_t i = 0; i < 29; i++) // RSSI value followed by 4*7 bytes of telemetry data
Serial_write(packet_in[i]); Serial_write(packet_in[i]);
} }
@ -300,11 +255,7 @@ static void multi_send_status()
#ifdef HITEC_FW_TELEMETRY #ifdef HITEC_FW_TELEMETRY
void HITEC_short_frame() void HITEC_short_frame()
{ {
#if defined MULTI_TELEMETRY
multi_send_header(MULTI_TELEMETRY_HITEC, 8); multi_send_header(MULTI_TELEMETRY_HITEC, 8);
#else
Serial_write(0xAA); // Telemetry packet
#endif
for (uint8_t i = 0; i < 8; i++) // TX RSSI and TX LQI values followed by frame number and 5 bytes of telemetry data for (uint8_t i = 0; i < 8; i++) // TX RSSI and TX LQI values followed by frame number and 5 bytes of telemetry data
Serial_write(packet_in[i]); Serial_write(packet_in[i]);
} }
@ -313,24 +264,20 @@ static void multi_send_status()
#ifdef HOTT_FW_TELEMETRY #ifdef HOTT_FW_TELEMETRY
void HOTT_short_frame() void HOTT_short_frame()
{ {
#if defined MULTI_TELEMETRY
multi_send_header(MULTI_TELEMETRY_HOTT, 14); multi_send_header(MULTI_TELEMETRY_HOTT, 14);
#else
Serial_write(0xAA); // Telemetry packet
#endif
for (uint8_t i = 0; i < 14; i++) // TX RSSI and TX LQI values followed by frame number and telemetry data for (uint8_t i = 0; i < 14; i++) // TX RSSI and TX LQI values followed by frame number and telemetry data
Serial_write(packet_in[i]); Serial_write(packet_in[i]);
} }
#endif #endif
#ifdef MULTI_TELEMETRY
static void multi_send_frskyhub() static void multi_send_frskyhub()
{ {
multi_send_header(MULTI_TELEMETRY_HUB, 9); multi_send_header(MULTI_TELEMETRY_HUB, 9);
for (uint8_t i = 0; i < 9; i++) for (uint8_t i = 0; i < 9; i++)
Serial_write(frame[i]); Serial_write(frame[i]);
} }
#endif
#endif //MULTI_TELEMETRY
void frskySendStuffed() void frskySendStuffed()
{ {
@ -877,7 +824,7 @@ void TelemetryUpdate()
debugln("TEL_BUF %d",t); debugln("TEL_BUF %d",t);
*/ */
#endif #endif
#if defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) #ifdef MULTI_TELEMETRY
uint32_t now = millis(); uint32_t now = millis();
if ((IS_SEND_MULTI_STATUS_on || ((now - lastMulti) > MULTI_TIME))&& protocol != PROTO_SCANNER) if ((IS_SEND_MULTI_STATUS_on || ((now - lastMulti) > MULTI_TIME))&& protocol != PROTO_SCANNER)
{ {
@ -923,6 +870,7 @@ void TelemetryUpdate()
} }
#endif // SPORT_TELEMETRY #endif // SPORT_TELEMETRY
#ifdef MULTI_TELEMETRY
#if defined DSM_TELEMETRY #if defined DSM_TELEMETRY
if(telemetry_link && protocol == PROTO_DSM) if(telemetry_link && protocol == PROTO_DSM)
{ // DSM { // DSM
@ -955,7 +903,6 @@ void TelemetryUpdate()
return; return;
} }
#endif #endif
#if defined SCANNER_TELEMETRY #if defined SCANNER_TELEMETRY
if (telemetry_link && protocol == PROTO_SCANNER) if (telemetry_link && protocol == PROTO_SCANNER)
{ {
@ -964,7 +911,6 @@ void TelemetryUpdate()
return; return;
} }
#endif #endif
#if defined (FRSKY_RX_TELEMETRY) || defined(AFHDS2A_RX_TELEMETRY) || defined (BAYANG_RX_TELEMETRY) || defined (DSM_RX_CYRF6936_INO) #if defined (FRSKY_RX_TELEMETRY) || defined(AFHDS2A_RX_TELEMETRY) || defined (BAYANG_RX_TELEMETRY) || defined (DSM_RX_CYRF6936_INO)
if ((telemetry_link & 1) && (protocol == PROTO_FRSKY_RX || protocol == PROTO_AFHDS2A_RX || protocol == PROTO_BAYANG_RX || protocol == PROTO_DSM_RX) ) if ((telemetry_link & 1) && (protocol == PROTO_FRSKY_RX || protocol == PROTO_AFHDS2A_RX || protocol == PROTO_BAYANG_RX || protocol == PROTO_DSM_RX) )
{ {
@ -973,6 +919,7 @@ void TelemetryUpdate()
return; return;
} }
#endif #endif
#endif //MULTI_TELEMETRY
if( telemetry_link & 1 ) if( telemetry_link & 1 )
{ // FrSkyD + Hubsan + AFHDS2A + Bayang + Cabell + Hitec + Bugs + BugsMini + NCC1701 + PROPEL + RLINK + OMP + MLINK { // FrSkyD + Hubsan + AFHDS2A + Bayang + Cabell + Hitec + Bugs + BugsMini + NCC1701 + PROPEL + RLINK + OMP + MLINK

View File

@ -223,10 +223,6 @@
#define NRF24L01_INSTALLED #define NRF24L01_INSTALLED
#define SX1276_INSTALLED #define SX1276_INSTALLED
#undef ENABLE_PPM #undef ENABLE_PPM
#ifdef MLINK_CYRF6936_INO
#undef MLINK_CYRF6936_INO
#warning "Disabling the MLink protocol to fit in the Flash."
#endif
#endif #endif
//Make sure protocols are selected correctly //Make sure protocols are selected correctly
@ -345,7 +341,6 @@
#undef SPORT_TELEMETRY #undef SPORT_TELEMETRY
#undef SPORT_SEND #undef SPORT_SEND
#undef DSM_TELEMETRY #undef DSM_TELEMETRY
#undef MULTI_STATUS
#undef MULTI_TELEMETRY #undef MULTI_TELEMETRY
#undef SCANNER_TELEMETRY #undef SCANNER_TELEMETRY
#undef SCANNER_CC2500_INO #undef SCANNER_CC2500_INO
@ -365,9 +360,6 @@
#undef WFLY2_HUB_TELEMETRY #undef WFLY2_HUB_TELEMETRY
#undef LOLI_HUB_TELEMETRY #undef LOLI_HUB_TELEMETRY
#else #else
#if defined(MULTI_TELEMETRY) && defined(MULTI_STATUS)
#error You should choose either MULTI_TELEMETRY or MULTI_STATUS but not both.
#endif
#if not defined(SCANNER_CC2500_INO) || not defined(SCANNER_TELEMETRY) #if not defined(SCANNER_CC2500_INO) || not defined(SCANNER_TELEMETRY)
#undef SCANNER_TELEMETRY #undef SCANNER_TELEMETRY
#undef SCANNER_CC2500_INO #undef SCANNER_CC2500_INO
@ -448,7 +440,6 @@
#undef TELEMETRY #undef TELEMETRY
#undef INVERT_TELEMETRY #undef INVERT_TELEMETRY
#undef MULTI_TELEMETRY #undef MULTI_TELEMETRY
#undef MULTI_STATUS
#endif #endif
#endif #endif

View File

@ -304,13 +304,9 @@
//For STM32 and OrangeRX modules, comment to prevent the TX from forcing the serial telemetry polarity normal/invert. //For STM32 and OrangeRX modules, comment to prevent the TX from forcing the serial telemetry polarity normal/invert.
#define INVERT_TELEMETRY_TX #define INVERT_TELEMETRY_TX
//Uncomment if you want to send Multi status telemetry frames (Protocol available, Bind in progress, version...) //Sends Multi status and allow OpenTX and erskyTX to autodetect the telemetry format. Comment to disable.
//Use with er9x/erskyTX, for OpenTX you must select MULTI_TELEMETRY below
//#define MULTI_STATUS
//Sends Multi status and allow OpenTX to autodetect the telemetry format. Comment to disable.
//Supported by OpenTX version 2.2 RC9 and newer. NOT supported by er9x/erskyTX use MULTI_STATUS instead.
#define MULTI_TELEMETRY #define MULTI_TELEMETRY
//Work in progress: Sync OpenTX frames with the current protocol timing. This feature is only available on the STM32 module. Uncomment to enable. //Work in progress: Sync OpenTX frames with the current protocol timing. This feature is only available on the STM32 module. Uncomment to enable.
//#define MULTI_SYNC //#define MULTI_SYNC
@ -332,7 +328,7 @@
#define WFLY2_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define WFLY2_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define LOLI_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define LOLI_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define MLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define MLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define HITEC_HUB_TELEMETRY // Use FrSkyD Hub format to send basic telemetry to the radios which can decode it like er9x, erskyTX and OpenTX //#define HITEC_HUB_TELEMETRY // Use FrSkyD Hub format to send basic telemetry to the radios which can decode it like er9x, erskyTX and OpenTX
#define HITEC_FW_TELEMETRY // Forward received telemetry packets to be decoded by erskyTX and OpenTX #define HITEC_FW_TELEMETRY // Forward received telemetry packets to be decoded by erskyTX and OpenTX
#define SCANNER_TELEMETRY // Forward spectrum scanner data to TX #define SCANNER_TELEMETRY // Forward spectrum scanner data to TX
#define FRSKY_RX_TELEMETRY // Forward channels data to TX #define FRSKY_RX_TELEMETRY // Forward channels data to TX

View File

@ -10,7 +10,6 @@
#define Module_1 #define Module_1
//#define Module_2 //#define Module_2
//#define Module_3 //#define Module_3
//#define Module_4
//Example on how to force the "Flash from TX" feature for all modules //Example on how to force the "Flash from TX" feature for all modules
#define CHECK_FOR_BOOTLOADER #define CHECK_FOR_BOOTLOADER
@ -48,11 +47,6 @@
#undef INVERT_TELEMETRY #undef INVERT_TELEMETRY
#elif defined Module_3 #elif defined Module_3
//Example of a module which will be used with OpenTX
#undef MULTI_STATUS
#define MULTI_TELEMETRY
#elif defined Module_4
//Example of a module which will be PPM only with a different protocol table //Example of a module which will be PPM only with a different protocol table
#undef ENABLE_SERIAL #undef ENABLE_SERIAL
#undef NBR_BANKS #undef NBR_BANKS