Complete KISSCC and fix simplex TX case
This commit is contained in:
parent
b2ed74cd1e
commit
d7f79bc3ca
|
@ -260,7 +260,16 @@ serialPort_t *openSoftSerial(softSerialPortIndex_e portIndex, serialReceiveCallb
|
|||
return NULL;
|
||||
|
||||
softSerial->txIO = txIO;
|
||||
|
||||
if (!(mode & MODE_RX)) {
|
||||
// TX Simplex, must have a timer
|
||||
if (!timerTx)
|
||||
return NULL;
|
||||
softSerial->timerHardware = timerTx;
|
||||
} else {
|
||||
// Duplex
|
||||
softSerial->exTimerHardware = timerTx;
|
||||
}
|
||||
IOInit(txIO, OWNER_SERIAL_TX, RESOURCE_INDEX(portIndex) + RESOURCE_SOFT_OFFSET);
|
||||
}
|
||||
}
|
||||
|
@ -449,7 +458,6 @@ void processRxState(softSerial_t *softSerial)
|
|||
void onSerialTimerOverflow(timerOvrHandlerRec_t *cbRec, captureCompare_t capture)
|
||||
{
|
||||
UNUSED(capture);
|
||||
|
||||
softSerial_t *self = container_of(cbRec, softSerial_t, overCb);
|
||||
|
||||
if (self->port.mode & MODE_TX)
|
||||
|
|
|
@ -64,7 +64,6 @@
|
|||
#define USE_UART1
|
||||
#define USE_UART2
|
||||
#define USE_UART3
|
||||
#define SERIAL_PORT_COUNT 4
|
||||
|
||||
#define UART1_TX_PIN PA9
|
||||
#define UART1_RX_PIN PA10
|
||||
|
@ -75,13 +74,13 @@
|
|||
#define UART3_TX_PIN PB10 // PB10 (AF7)
|
||||
#define UART3_RX_PIN PB11 // PB11 (AF7)
|
||||
|
||||
// XXX 11 is out of bound
|
||||
/*
|
||||
#ifdef KISSCC
|
||||
#define SOFTSERIAL_1_TIMER_RX_HARDWARE 11
|
||||
#define SOFTSERIAL_1_TIMER_TX_HARDWARE 11
|
||||
#define USE_SOFTSERIAL1
|
||||
#define SOFTSERIAL1_TX_PIN PA13
|
||||
#define SERIAL_PORT_COUNT 5
|
||||
#else
|
||||
#define SERIAL_PORT_COUNT 4
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define USE_I2C
|
||||
#define I2C_DEVICE (I2CDEV_1) // PB6/SCL, PB7/SDA
|
||||
|
|
Loading…
Reference in New Issue