mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
decouple cli/msp from each other. relocated non-msp code into
serial_common.c/h. decouple runtime_config from serial ports. decouple buzzer from serial ports. decouple opening of the main serial port from the msp code. decouple serial rx providers from runtime_config. rename core_t to serialPorts_t since it only contained serial ports. It's now clear which files use serial ports based on the header files they include.
This commit is contained in:
parent
2baf385b99
commit
a7e4c859bd
26 changed files with 209 additions and 135 deletions
24
src/serial_common.h
Normal file
24
src/serial_common.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#pragma once
|
||||
|
||||
typedef struct serialPorts_s {
|
||||
serialPort_t *mainport;
|
||||
serialPort_t *gpsport;
|
||||
serialPort_t *telemport;
|
||||
serialPort_t *rcvrport;
|
||||
} serialPorts_t;
|
||||
|
||||
typedef struct serialConfig_s {
|
||||
uint32_t port1_baudrate;
|
||||
|
||||
uint32_t softserial_baudrate; // shared by both soft serial ports
|
||||
uint8_t softserial_1_inverted; // use inverted softserial input and output signals on port 1
|
||||
uint8_t softserial_2_inverted; // use inverted softserial input and output signals on port 2
|
||||
uint8_t reboot_character; // which byte is used to reboot. Default 'R', could be changed carefully to something else.
|
||||
} serialConfig_t;
|
||||
|
||||
extern serialPorts_t serialPorts;
|
||||
|
||||
void resetMainSerialPort(void);
|
||||
void openMainSerialPort(uint32_t baudrate);
|
||||
void evaluateOtherData(uint8_t sr);
|
||||
void handleSerial(void);
|
Loading…
Add table
Add a link
Reference in a new issue