mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
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.
24 lines
886 B
C
24 lines
886 B
C
#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);
|