mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-26 01:35:41 +03:00
Add first unit test for some code in serial.c. Fix compiler warnings in
other tests.
This commit is contained in:
parent
8a9d2e3708
commit
b0b1eaf9c7
10 changed files with 164 additions and 61 deletions
|
@ -24,40 +24,6 @@ typedef enum {
|
|||
SOFTSERIAL2
|
||||
} softSerialPortIndex_e;
|
||||
|
||||
typedef struct softSerial_s {
|
||||
serialPort_t port;
|
||||
|
||||
const timerHardware_t *rxTimerHardware;
|
||||
volatile uint8_t rxBuffer[SOFTSERIAL_BUFFER_SIZE];
|
||||
|
||||
const timerHardware_t *txTimerHardware;
|
||||
volatile uint8_t txBuffer[SOFTSERIAL_BUFFER_SIZE];
|
||||
|
||||
uint8_t isSearchingForStartBit;
|
||||
uint8_t rxBitIndex;
|
||||
uint8_t rxLastLeadingEdgeAtBitIndex;
|
||||
uint8_t rxEdge;
|
||||
|
||||
uint8_t isTransmittingData;
|
||||
int8_t bitsLeftToTransmit;
|
||||
|
||||
uint16_t internalTxBuffer; // includes start and stop bits
|
||||
uint16_t internalRxBuffer; // includes start and stop bits
|
||||
|
||||
uint16_t transmissionErrors;
|
||||
uint16_t receiveErrors;
|
||||
|
||||
uint8_t softSerialPortIndex;
|
||||
|
||||
timerCCHandlerRec_t timerCb;
|
||||
timerCCHandlerRec_t edgeCb;
|
||||
} softSerial_t;
|
||||
|
||||
extern timerHardware_t* serialTimerHardware;
|
||||
extern softSerial_t softSerialPorts[];
|
||||
|
||||
extern const struct serialPortVTable softSerialVTable[];
|
||||
|
||||
serialPort_t *openSoftSerial(softSerialPortIndex_e portIndex, serialReceiveCallbackPtr callback, uint32_t baud, portOptions_t options);
|
||||
|
||||
// serialPort API
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue