mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
Add dynamic Baudrates
This commit is contained in:
parent
ec923b6180
commit
a0b8faa7b8
2 changed files with 11 additions and 1 deletions
|
@ -21,6 +21,11 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
typedef enum {
|
||||
BAUDRATE_NORMAL = 19200,
|
||||
BAUDRATE_KISS = 38400
|
||||
} escBaudRate_e;
|
||||
|
||||
#if defined(USE_ESCSERIAL)
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
@ -854,7 +859,9 @@ void escEnablePassthrough(serialPort_t *escPassthroughPort, uint16_t output, uin
|
|||
if(motor_output >=USABLE_TIMER_CHANNEL_COUNT)
|
||||
return;
|
||||
|
||||
escPort = openEscSerial(ESCSERIAL1, NULL, motor_output, 19200, 0, mode);
|
||||
uint32_t escBaudrate = (mode == 2) ? BAUDRATE_KISS : BAUDRATE_NORMAL;
|
||||
|
||||
escPort = openEscSerial(ESCSERIAL1, NULL, motor_output, escBaudrate, 0, mode);
|
||||
uint8_t ch;
|
||||
while(1) {
|
||||
if (serialRxBytesWaiting(escPort)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue