From 701f17df90f4301c1078dd5049a7f6d73f7f7c59 Mon Sep 17 00:00:00 2001 From: midelic Date: Sat, 27 Aug 2016 09:29:57 +0100 Subject: [PATCH] Fixes --- Multiprotocol/Telemetry.ino | 40 ++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Multiprotocol/Telemetry.ino b/Multiprotocol/Telemetry.ino index 6526b41..9b4c2b8 100644 --- a/Multiprotocol/Telemetry.ino +++ b/Multiprotocol/Telemetry.ino @@ -401,7 +401,45 @@ void frskyUpdate() last = now; } } - #endif + #endif + +#ifdef BASH_SERIAL + uint8_t h ; + uint8_t t ; + h = SerialControl.head ; + t = SerialControl.tail ; + if ( h >= t ) + { + t += 64 - h ; + } + else + { + t -= h ; + } + if ( t < 32 ) + { + return ; + } + +#else + uint8_t h ; + uint8_t t ; + h = tx_head ; + t = tx_tail ; + if ( h >= t ) + { + t += TXBUFFER_SIZE - h ; + } + else + { + t -= h ; + } + if ( t < 16 ) + { + return ; + } +#endif + } #endif