mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Removed softserial loopback.
This commit is contained in:
parent
1a97cbc9db
commit
54588cf7dd
3 changed files with 0 additions and 28 deletions
|
@ -176,25 +176,8 @@
|
||||||
void targetPreInit(void);
|
void targetPreInit(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SOFTSERIAL_LOOPBACK
|
|
||||||
serialPort_t *loopbackPort;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t systemState = SYSTEM_STATE_INITIALISING;
|
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
|
#ifdef BUS_SWITCH_PIN
|
||||||
void busSwitchInit(void)
|
void busSwitchInit(void)
|
||||||
{
|
{
|
||||||
|
@ -874,15 +857,6 @@ void init(void)
|
||||||
timerStart();
|
timerStart();
|
||||||
#endif
|
#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.
|
batteryInit(); // always needs doing, regardless of features.
|
||||||
|
|
||||||
#ifdef USE_RCDEVICE
|
#ifdef USE_RCDEVICE
|
||||||
|
|
|
@ -32,4 +32,3 @@ typedef enum {
|
||||||
extern uint8_t systemState;
|
extern uint8_t systemState;
|
||||||
|
|
||||||
void init(void);
|
void init(void);
|
||||||
void processLoopback(void);
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ void FAST_CODE FAST_CODE_NOINLINE run(void)
|
||||||
{
|
{
|
||||||
while (true) {
|
while (true) {
|
||||||
scheduler();
|
scheduler();
|
||||||
processLoopback();
|
|
||||||
#ifdef SIMULATOR_BUILD
|
#ifdef SIMULATOR_BUILD
|
||||||
delayMicroseconds_real(50); // max rate 20kHz
|
delayMicroseconds_real(50); // max rate 20kHz
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue