1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

Revert "Fix 1wire pass through for F3 + target config changes"

This reverts commit c2b1dd3259.
This commit is contained in:
4712 2015-11-05 00:28:49 +01:00
parent c2b1dd3259
commit 42523e4bcb
5 changed files with 16 additions and 47 deletions

View file

@ -1799,32 +1799,13 @@ static bool processInCommand(void)
headSerialReply(0);
tailSerialReply();
// wait for all data to send
waitForSerialPortToFinishTransmitting(currentPort->port);
while (!isSerialTransmitBufferEmpty(mspSerialPort)) {
delay(50);
}
// Start to activate here
// motor 1 => index 0
// search currentPort portIndex
/* next lines seems to be unnecessary, because the currentPort always point to the same mspPorts[portIndex]
uint8_t portIndex;
for (portIndex = 0; portIndex < MAX_MSP_PORT_COUNT; portIndex++) {
if (currentPort == &mspPorts[portIndex]) {
break;
}
}
*/
mspReleasePortIfAllocated(mspSerialPort); // CloseSerialPort also marks currentPort as UNUSED_PORT
usb1WirePassthrough(i);
// Wait a bit more to let App read the 0 byte and switch baudrate
// 2ms will most likely do the job, but give some grace time
delay(10);
// rebuild/refill currentPort structure, does openSerialPort if marked UNUSED_PORT - used ports are skiped
mspAllocateSerialPorts(&masterConfig.serialConfig);
/* restore currentPort and mspSerialPort
setCurrentPort(&mspPorts[portIndex]); // not needed same index will be restored
*/
// former used MSP uart is active again
// restore MSP_SET_1WIRE as current command for correct headSerialReply(0)
currentPort->cmdMSP = MSP_SET_1WIRE;
// MPS uart is active again
} else {
// ESC channel higher than max. allowed
// rem: BLHeliSuite will not support more than 8