mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Merge pull request #3660 from martinbudden/bf_uart_tidy
Tidied UART enum definitions
This commit is contained in:
commit
b1ec3d04f2
34 changed files with 65 additions and 73 deletions
|
@ -388,7 +388,7 @@ bool feature(uint32_t) {return false;}
|
|||
void mspSerialReleasePortIfAllocated(serialPort_t *) {}
|
||||
serialPortConfig_t *findSerialPortConfig(serialPortFunction_e ) {return NULL;}
|
||||
serialPort_t *findSharedSerialPort(uint16_t , serialPortFunction_e ) {return NULL;}
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_t, portOptions_t) {return NULL;}
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_e, portOptions_e) {return NULL;}
|
||||
void closeSerialPort(serialPort_t *) {}
|
||||
portSharing_e determinePortSharing(const serialPortConfig_t *, serialPortFunction_e ) {return PORTSHARING_UNUSED;}
|
||||
failsafePhase_e failsafePhase(void) {return FAILSAFE_IDLE;}
|
||||
|
|
|
@ -212,9 +212,9 @@ void writeEEPROM() {}
|
|||
serialPortConfig_t *serialFindPortConfiguration(serialPortIdentifier_e) {return NULL; }
|
||||
baudRate_e lookupBaudRateIndex(uint32_t){return BAUD_9600; }
|
||||
serialPortUsage_t *findSerialPortUsageByIdentifier(serialPortIdentifier_e){ return NULL; }
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_t, portOptions_t) { return NULL; }
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_e, portOptions_e) { return NULL; }
|
||||
void serialSetBaudRate(serialPort_t *, uint32_t) {}
|
||||
void serialSetMode(serialPort_t *, portMode_t) {}
|
||||
void serialSetMode(serialPort_t *, portMode_e) {}
|
||||
void serialPassthrough(serialPort_t *, serialPort_t *, serialConsumer *, serialConsumer *) {}
|
||||
uint32_t millis(void) { return 0; }
|
||||
uint8_t getBatteryCellCount(void) { return 1; }
|
||||
|
|
|
@ -64,11 +64,11 @@ extern "C" {
|
|||
|
||||
serialPort_t *usbVcpOpen(void) { return NULL; }
|
||||
|
||||
serialPort_t *uartOpen(UARTDevice, serialReceiveCallbackPtr, uint32_t, portMode_t, portOptions_t) {
|
||||
serialPort_t *uartOpen(UARTDevice_e, serialReceiveCallbackPtr, uint32_t, portMode_e, portOptions_e) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
serialPort_t *openSoftSerial(softSerialPortIndex_e, serialReceiveCallbackPtr, uint32_t, portMode_t, portOptions_t) {
|
||||
serialPort_t *openSoftSerial(softSerialPortIndex_e, serialReceiveCallbackPtr, uint32_t, portMode_e, portOptions_e) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -311,7 +311,7 @@ TEST(RCSplitTest, TestWifiModeChangeCombine)
|
|||
}
|
||||
|
||||
extern "C" {
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e identifier, serialPortFunction_e functionMask, serialReceiveCallbackPtr callback, uint32_t baudRate, portMode_t mode, portOptions_t options)
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e identifier, serialPortFunction_e functionMask, serialReceiveCallbackPtr callback, uint32_t baudRate, portMode_e mode, portOptions_e options)
|
||||
{
|
||||
UNUSED(identifier);
|
||||
UNUSED(functionMask);
|
||||
|
|
|
@ -275,7 +275,7 @@ extern "C" {
|
|||
|
||||
int16_t debug[DEBUG16_VALUE_COUNT];
|
||||
uint32_t micros(void) {return dummyTimeUs;}
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_t, portOptions_t) {return NULL;}
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_e, portOptions_e) {return NULL;}
|
||||
serialPortConfig_t *findSerialPortConfig(serialPortFunction_e ) {return NULL;}
|
||||
void serialWriteBuf(serialPort_t *, const uint8_t *, int) {}
|
||||
bool telemetryCheckRxPortShared(const serialPortConfig_t *) {return false;}
|
||||
|
|
|
@ -104,16 +104,16 @@ serialPortConfig_t *findSerialPortConfig(serialPortFunction_e function)
|
|||
return findSerialPortConfig_stub_retval;
|
||||
}
|
||||
|
||||
static portMode_t serialExpectedMode = MODE_RX;
|
||||
static portOptions_t serialExpectedOptions = SERIAL_UNIDIR;
|
||||
static portMode_e serialExpectedMode = MODE_RX;
|
||||
static portOptions_e serialExpectedOptions = SERIAL_UNIDIR;
|
||||
|
||||
serialPort_t *openSerialPort(
|
||||
serialPortIdentifier_e identifier,
|
||||
serialPortFunction_e function,
|
||||
serialReceiveCallbackPtr callback,
|
||||
uint32_t baudrate,
|
||||
portMode_t mode,
|
||||
portOptions_t options
|
||||
portMode_e mode,
|
||||
portOptions_e options
|
||||
)
|
||||
{
|
||||
openSerial_called = true;
|
||||
|
|
|
@ -288,8 +288,8 @@ uint32_t serialTxBytesFree(const serialPort_t *) {return 0;}
|
|||
uint8_t serialRead(serialPort_t *) {return 0;}
|
||||
void serialWrite(serialPort_t *, uint8_t) {}
|
||||
void serialWriteBuf(serialPort_t *, const uint8_t *, int) {}
|
||||
void serialSetMode(serialPort_t *, portMode_t ) {}
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_t, portOptions_t) {return NULL;}
|
||||
void serialSetMode(serialPort_t *, portMode_e) {}
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e, serialPortFunction_e, serialReceiveCallbackPtr, uint32_t, portMode_e, portOptions_e) {return NULL;}
|
||||
void closeSerialPort(serialPort_t *) {}
|
||||
|
||||
serialPortConfig_t *findSerialPortConfig(serialPortFunction_e) {return NULL;}
|
||||
|
|
|
@ -213,13 +213,13 @@ void serialWrite(serialPort_t *instance, uint8_t ch)
|
|||
UNUSED(ch);
|
||||
}
|
||||
|
||||
void serialSetMode(serialPort_t *instance, portMode_t mode)
|
||||
void serialSetMode(serialPort_t *instance, portMode_e mode)
|
||||
{
|
||||
UNUSED(instance);
|
||||
UNUSED(mode);
|
||||
}
|
||||
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e identifier, serialPortFunction_e functionMask, serialReceiveCallbackPtr callback, uint32_t baudRate, portMode_t mode, portOptions_t options)
|
||||
serialPort_t *openSerialPort(serialPortIdentifier_e identifier, serialPortFunction_e functionMask, serialReceiveCallbackPtr callback, uint32_t baudRate, portMode_e mode, portOptions_e options)
|
||||
{
|
||||
UNUSED(identifier);
|
||||
UNUSED(functionMask);
|
||||
|
|
|
@ -141,8 +141,8 @@ serialPort_t *openSerialPort(
|
|||
serialPortFunction_e function,
|
||||
serialReceiveCallbackPtr callback,
|
||||
uint32_t baudrate,
|
||||
portMode_t mode,
|
||||
portOptions_t options
|
||||
portMode_e mode,
|
||||
portOptions_e options
|
||||
)
|
||||
{
|
||||
openSerial_called = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue