Merge pull request #7603 from fujin/smartaudio-lite-softserial

SmartAudio Lite compatibility: Send 0x00 bit(s) (always) even with Soft Serial.
This commit is contained in:
J Blackman 2019-02-19 01:55:36 +11:00 committed by GitHub
commit 12a843ae4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -450,14 +450,7 @@ static void saReceiveFrame(uint8_t c)
static void saSendFrame(uint8_t *buf, int len)
{
if (!IS_RC_MODE_ACTIVE(BOXVTXCONTROLDISABLE)) {
switch (smartAudioSerialPort->identifier) {
case SERIAL_PORT_SOFTSERIAL1:
case SERIAL_PORT_SOFTSERIAL2:
break;
default:
serialWrite(smartAudioSerialPort, 0x00); // Generate 1st start bit
break;
}
serialWrite(smartAudioSerialPort, 0x00); // Ensure line is low regardless of hardware pull-down capabilities.
for (int i = 0 ; i < len ; i++) {
serialWrite(smartAudioSerialPort, buf[i]);
@ -468,6 +461,7 @@ static void saSendFrame(uint8_t *buf, int len)
sa_outstanding = SA_CMD_NONE;
}
serialWrite(smartAudioSerialPort, 0x00); // Pull the line low again after sending frame.
sa_lastTransmissionMs = millis();
}