Merge pull request #10949 from mikeller/remove_softserial_loopback

This commit is contained in:
Michael Keller 2021-09-28 02:23:36 +13:00 committed by GitHub
commit 78cbd4a850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 28 deletions

View File

@ -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

View File

@ -32,4 +32,3 @@ typedef enum {
extern uint8_t systemState;
void init(void);
void processLoopback(void);

View File

@ -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