Improved sbus handling with a possibility to abandon stuck SBUS frames

This commit is contained in:
Pawel Spychalski (DzikuVx)
2018-04-28 21:00:19 +02:00
parent 0f0dbf6cb3
commit 6a121df25d
3 changed files with 73 additions and 38 deletions

View File

@@ -342,8 +342,13 @@ void loop(void)
*/
#ifdef DEVICE_MODE_TX
txInput.recoverStuckFrames();
static uint32_t serialRestartMillis = 0;
/*
* Final guard for SBUS input. If there is no input, try to restart serial port
*/
if (!txInput.isReceiving() && serialRestartMillis + 100 < currentMillis) {
txInput.restart();
serialRestartMillis = currentMillis;