1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Add dynamic Baudrates

This commit is contained in:
borisbstyle 2016-10-22 17:05:09 +02:00
parent ec923b6180
commit a0b8faa7b8
2 changed files with 11 additions and 1 deletions

View file

@ -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)) {

View file

@ -80,6 +80,9 @@
#define USE_I2C
#define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA
#define USE_ESCSERIAL
#define ESCSERIAL_TIMER_TX_HARDWARE 0 // PWM 1
#define USE_SPI
#define USE_SPI_DEVICE_1