Merge pull request #10949 from mikeller/remove_softserial_loopback
This commit is contained in:
commit
78cbd4a850
|
@ -176,25 +176,8 @@
|
|||
void targetPreInit(void);
|
||||
#endif
|
||||
|
||||
#ifdef SOFTSERIAL_LOOPBACK
|
||||
serialPort_t *loopbackPort;
|
||||
#endif
|
||||
|
||||
uint8_t systemState = SYSTEM_STATE_INITIALISING;
|
||||
|
||||
void processLoopback(void)
|
||||
{
|
||||
#ifdef SOFTSERIAL_LOOPBACK
|
||||
if (loopbackPort) {
|
||||
uint8_t bytesWaiting;
|
||||
while ((bytesWaiting = serialRxBytesWaiting(loopbackPort))) {
|
||||
uint8_t b = serialRead(loopbackPort);
|
||||
serialWrite(loopbackPort, b);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef BUS_SWITCH_PIN
|
||||
void busSwitchInit(void)
|
||||
{
|
||||
|
@ -874,15 +857,6 @@ void init(void)
|
|||
timerStart();
|
||||
#endif
|
||||
|
||||
#ifdef SOFTSERIAL_LOOPBACK
|
||||
// FIXME this is a hack, perhaps add a FUNCTION_LOOPBACK to support it properly
|
||||
loopbackPort = (serialPort_t*)&(softSerialPorts[0]);
|
||||
if (!loopbackPort->vTable) {
|
||||
loopbackPort = openSoftSerial(0, NULL, 19200, SERIAL_NOT_INVERTED);
|
||||
}
|
||||
serialPrint(loopbackPort, "LOOPBACK\r\n");
|
||||
#endif
|
||||
|
||||
batteryInit(); // always needs doing, regardless of features.
|
||||
|
||||
#ifdef USE_RCDEVICE
|
||||
|
|
|
@ -32,4 +32,3 @@ typedef enum {
|
|||
extern uint8_t systemState;
|
||||
|
||||
void init(void);
|
||||
void processLoopback(void);
|
||||
|
|
|
@ -42,7 +42,6 @@ void FAST_CODE FAST_CODE_NOINLINE run(void)
|
|||
{
|
||||
while (true) {
|
||||
scheduler();
|
||||
processLoopback();
|
||||
#ifdef SIMULATOR_BUILD
|
||||
delayMicroseconds_real(50); // max rate 20kHz
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue