diff --git a/src/main/drivers/serial_escserial.c b/src/main/drivers/serial_escserial.c index 79cbdc9744..91bc79d905 100644 --- a/src/main/drivers/serial_escserial.c +++ b/src/main/drivers/serial_escserial.c @@ -50,6 +50,7 @@ typedef enum { BAUDRATE_NORMAL = 19200, + BAUDRATE_SIMONK = 28800, // = 9600 * 3 BAUDRATE_KISS = 38400, BAUDRATE_CASTLE = 18880 } escBaudRate_e; @@ -432,6 +433,7 @@ static void serialTimerRxConfigBL(const timerHardware_t *timerHardwarePtr, uint8 timerChConfigCallbacks(timerHardwarePtr, &escSerialPorts[reference].edgeCb, NULL); } +#ifdef USE_ESCSERIAL_SIMONK static void processTxStateEsc(escSerial_t *escSerial) { uint8_t mask; @@ -643,6 +645,7 @@ static void escSerialTimerRxConfig(const timerHardware_t *timerHardwarePtr, uint timerChCCHandlerInit(&escSerialPorts[reference].edgeCb, onSerialRxPinChangeEsc); timerChConfigCallbacks(timerHardwarePtr, &escSerialPorts[reference].edgeCb, NULL); } +#endif static void resetBuffers(escSerial_t *escSerial) { @@ -706,11 +709,14 @@ static serialPort_t *openEscSerial(escSerialPortIndex_e portIndex, serialReceive } delay(50); +#ifdef USE_ESCSERIAL_SIMONK if (mode==PROTOCOL_SIMONK) { escSerialTimerTxConfig(escSerial->txTimerHardware, portIndex); escSerialTimerRxConfig(escSerial->rxTimerHardware, portIndex); } - else if (mode==PROTOCOL_BLHELI) { + else +#endif + if (mode==PROTOCOL_BLHELI) { serialTimerTxConfigBL(escSerial->txTimerHardware, portIndex, baud); serialTimerRxConfigBL(escSerial->rxTimerHardware, portIndex, options); } diff --git a/src/main/target/common_pre.h b/src/main/target/common_pre.h index 80e5be0b4e..b7fbbc0b0c 100644 --- a/src/main/target/common_pre.h +++ b/src/main/target/common_pre.h @@ -239,4 +239,5 @@ #define USE_ESC_SENSOR_TELEMETRY #define USE_OSD_PROFILES #define USE_OSD_STICK_OVERLAY +#define USE_ESCSERIAL_SIMONK #endif