mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
Merge pull request #7272 from jflyper/bfdev-escserial-simonk-separation
[F3, ESCSERIAL] Conditionalize SimonK handling from escserial and drop it from F3
This commit is contained in:
commit
ec64c89ae7
2 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -239,4 +239,5 @@
|
|||
#define USE_ESC_SENSOR_TELEMETRY
|
||||
#define USE_OSD_PROFILES
|
||||
#define USE_OSD_STICK_OVERLAY
|
||||
#define USE_ESCSERIAL_SIMONK
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue