AP_RCProtocol: add separate define for AP_RCPROTOCOL_ST24_ENABLED

This commit is contained in:
Peter Barker 2023-05-16 11:35:46 +10:00 committed by Andrew Tridgell
parent 5c815e2c32
commit 1225d4c88f
5 changed files with 16 additions and 4 deletions

View File

@ -66,7 +66,9 @@ void AP_RCProtocol::init()
#if AP_RCPROTOCOL_FPORT2_ENABLED #if AP_RCPROTOCOL_FPORT2_ENABLED
backend[AP_RCProtocol::FPORT2] = new AP_RCProtocol_FPort2(*this, true); backend[AP_RCProtocol::FPORT2] = new AP_RCProtocol_FPort2(*this, true);
#endif #endif
#if AP_RCPROTOCOL_ST24_ENABLED
backend[AP_RCProtocol::ST24] = new AP_RCProtocol_ST24(*this); backend[AP_RCProtocol::ST24] = new AP_RCProtocol_ST24(*this);
#endif
#if AP_RCPROTOCOL_FPORT_ENABLED #if AP_RCPROTOCOL_FPORT_ENABLED
backend[AP_RCProtocol::FPORT] = new AP_RCProtocol_FPort(*this, true); backend[AP_RCProtocol::FPORT] = new AP_RCProtocol_FPort(*this, true);
#endif #endif
@ -451,8 +453,10 @@ const char *AP_RCProtocol::protocol_name_from_protocol(rcprotocol_t protocol)
case CRSF: case CRSF:
return "CRSF"; return "CRSF";
#endif #endif
#if AP_RCPROTOCOL_ST24_ENABLED
case ST24: case ST24:
return "ST24"; return "ST24";
#endif
#if AP_RCPROTOCOL_FPORT_ENABLED #if AP_RCPROTOCOL_FPORT_ENABLED
case FPORT: case FPORT:
return "FPORT"; return "FPORT";

View File

@ -49,7 +49,9 @@ public:
#if AP_RCPROTOCOL_CRSF_ENABLED #if AP_RCPROTOCOL_CRSF_ENABLED
CRSF = 8, CRSF = 8,
#endif #endif
#if AP_RCPROTOCOL_ST24_ENABLED
ST24 = 9, ST24 = 9,
#endif
#if AP_RCPROTOCOL_FPORT_ENABLED #if AP_RCPROTOCOL_FPORT_ENABLED
FPORT = 10, FPORT = 10,
#endif #endif
@ -126,7 +128,9 @@ public:
#if AP_RCPROTOCOL_SRXL2_ENABLED #if AP_RCPROTOCOL_SRXL2_ENABLED
case SRXL2: case SRXL2:
#endif #endif
#if AP_RCPROTOCOL_ST24_ENABLED
case ST24: case ST24:
#endif
case NONE: case NONE:
return false; return false;
} }

View File

@ -44,7 +44,7 @@
*/ */
#include "AP_RCProtocol_config.h" #include "AP_RCProtocol_config.h"
#if AP_RCPROTOCOL_ENABLED #if AP_RCPROTOCOL_ST24_ENABLED
#include "AP_RCProtocol_ST24.h" #include "AP_RCProtocol_ST24.h"
@ -238,4 +238,4 @@ void AP_RCProtocol_ST24::process_byte(uint8_t byte, uint32_t baudrate)
_process_byte(byte); _process_byte(byte);
} }
#endif // AP_RCPROTOCOL_ENABLED #endif // AP_RCPROTOCOL_ST24_ENABLED

View File

@ -19,7 +19,7 @@
#include "AP_RCProtocol_config.h" #include "AP_RCProtocol_config.h"
#if AP_RCPROTOCOL_ENABLED #if AP_RCPROTOCOL_ST24_ENABLED
#include "AP_RCProtocol_Backend.h" #include "AP_RCProtocol_Backend.h"
#include "SoftSerial.h" #include "SoftSerial.h"
@ -154,4 +154,4 @@ private:
SoftSerial ss{115200, SoftSerial::SERIAL_CONFIG_8N1}; SoftSerial ss{115200, SoftSerial::SERIAL_CONFIG_8N1};
}; };
#endif // AP_RCPROTOCOL_ENABLED #endif // AP_RCPROTOCOL_ST24_ENABLED

View File

@ -34,6 +34,10 @@
#define AP_RCPROTOCOL_SRXL2_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED #define AP_RCPROTOCOL_SRXL2_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED
#endif #endif
#ifndef AP_RCPROTOCOL_ST24_ENABLED
#define AP_RCPROTOCOL_ST24_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_RCPROTOCOL_SBUS_NI_ENABLED #ifndef AP_RCPROTOCOL_SBUS_NI_ENABLED
#define AP_RCPROTOCOL_SBUS_NI_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED && AP_RCPROTOCOL_SBUS_ENABLED #define AP_RCPROTOCOL_SBUS_NI_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED && AP_RCPROTOCOL_SBUS_ENABLED