Lua S.PORT push fixed

BT telemetry fix attempt, untested
This commit is contained in:
Bertrand Songis
2019-04-17 09:15:40 +02:00
parent b69b617a9f
commit 5e9ff2bea2
5 changed files with 15 additions and 9 deletions
+5 -3
View File
@@ -255,7 +255,6 @@ void bluetoothSendTrainer()
void bluetoothForwardTelemetry(const uint8_t * packet)
{
bluetoothBufferIndex = 0;
bluetoothCrc = 0x00;
bluetoothBuffer[bluetoothBufferIndex++] = START_STOP; // start byte
@@ -264,8 +263,11 @@ void bluetoothForwardTelemetry(const uint8_t * packet)
}
bluetoothBuffer[bluetoothBufferIndex++] = bluetoothCrc;
bluetoothBuffer[bluetoothBufferIndex++] = START_STOP; // end byte
bluetoothWrite(bluetoothBuffer, bluetoothBufferIndex);
bluetoothBufferIndex = 0;
if (bluetoothBufferIndex >= 2*FRSKY_SPORT_PACKET_SIZE) {
bluetoothWrite(bluetoothBuffer, bluetoothBufferIndex);
bluetoothBufferIndex = 0;
}
}
void bluetoothReceiveTrainer()