feat: Automatic soft-serial fallback for module ports (#3823)

This commit is contained in:
Raphael Coeffic
2023-10-07 12:23:51 +10:00
committed by GitHub
parent 1e925edf4a
commit 3cbcc6b7bf
17 changed files with 130 additions and 83 deletions
+1 -6
View File
@@ -111,12 +111,7 @@ static etx_serial_init ppmMLinkSerialParams = {
static bool ppmInitMLinkTelemetry(uint8_t module)
{
// Try S.PORT hardware USART (requires HW inverters)
if (modulePortInitSerial(module, ETX_MOD_PORT_SPORT, &ppmMLinkSerialParams) != nullptr) {
return true;
}
// fall-back to softserial
if (modulePortInitSerial(module, ETX_MOD_PORT_SPORT_INV, &ppmMLinkSerialParams) != nullptr) {
if (modulePortInitSerial(module, ETX_MOD_PORT_SPORT, &ppmMLinkSerialParams, true) != nullptr) {
return true;
}