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
backend[AP_RCProtocol::FPORT2] = new AP_RCProtocol_FPort2(*this, true);
#endif
#if AP_RCPROTOCOL_ST24_ENABLED
backend[AP_RCProtocol::ST24] = new AP_RCProtocol_ST24(*this);
#endif
#if AP_RCPROTOCOL_FPORT_ENABLED
backend[AP_RCProtocol::FPORT] = new AP_RCProtocol_FPort(*this, true);
#endif
@ -451,8 +453,10 @@ const char *AP_RCProtocol::protocol_name_from_protocol(rcprotocol_t protocol)
case CRSF:
return "CRSF";
#endif
#if AP_RCPROTOCOL_ST24_ENABLED
case ST24:
return "ST24";
#endif
#if AP_RCPROTOCOL_FPORT_ENABLED
case FPORT:
return "FPORT";

View File

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

View File

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

View File

@ -19,7 +19,7 @@
#include "AP_RCProtocol_config.h"
#if AP_RCPROTOCOL_ENABLED
#if AP_RCPROTOCOL_ST24_ENABLED
#include "AP_RCProtocol_Backend.h"
#include "SoftSerial.h"
@ -154,4 +154,4 @@ private:
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
#endif
#ifndef AP_RCPROTOCOL_ST24_ENABLED
#define AP_RCPROTOCOL_ST24_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED
#endif
#ifndef AP_RCPROTOCOL_SBUS_NI_ENABLED
#define AP_RCPROTOCOL_SBUS_NI_ENABLED AP_RCPROTOCOL_BACKEND_DEFAULT_ENABLED && AP_RCPROTOCOL_SBUS_ENABLED