From 07a6cf92b7cdbda2277403a434a50247a9bb07f9 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Thu, 19 Jan 2017 12:43:21 +0100 Subject: [PATCH] smartport: removed disabling on timeout and refuse to initialise in case the port is shared with something else (would not work anyway). --- src/main/telemetry/smartport.c | 20 ++------------------ src/main/telemetry/smartport.h | 2 -- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/main/telemetry/smartport.c b/src/main/telemetry/smartport.c index b089714cc..d7d57cd0b 100644 --- a/src/main/telemetry/smartport.c +++ b/src/main/telemetry/smartport.c @@ -64,8 +64,7 @@ enum { SPSTATE_UNINITIALIZED, SPSTATE_INITIALIZED, - SPSTATE_WORKING, - SPSTATE_TIMEDOUT + SPSTATE_WORKING }; enum @@ -145,7 +144,6 @@ const uint16_t frSkyDataIdTable[] = { #define SMARTPORT_BAUD 57600 #define SMARTPORT_UART_MODE MODE_RXTX #define SMARTPORT_SERVICE_TIMEOUT_MS 1 // max allowed time to find a value to send -#define SMARTPORT_NOT_CONNECTED_TIMEOUT_MS 7000 static serialPort_t *smartPortSerialPort = NULL; // The 'SmartPort'(tm) Port. static serialPortConfig_t *portConfig; @@ -352,15 +350,9 @@ bool canSendSmartPortTelemetry(void) return smartPortSerialPort && (smartPortState == SPSTATE_INITIALIZED || smartPortState == SPSTATE_WORKING); } -bool isSmartPortTimedOut(void) -{ - return smartPortState >= SPSTATE_TIMEDOUT; -} - void checkSmartPortTelemetryState(void) { - bool newTelemetryEnabledValue = telemetryDetermineEnabledState(smartPortPortSharing); - + bool newTelemetryEnabledValue = (smartPortPortSharing == PORTSHARING_NOT_SHARED); if (newTelemetryEnabledValue == smartPortTelemetryEnabled) { return; } @@ -578,14 +570,6 @@ void handleSmartPortTelemetry(void) smartPortDataReceive(c); } - uint32_t now = millis(); - - // if timed out, reconfigure the UART back to normal so the GUI or CLI works - if ((now - smartPortLastRequestTime) > SMARTPORT_NOT_CONNECTED_TIMEOUT_MS) { - smartPortState = SPSTATE_TIMEDOUT; - return; - } - if(smartPortFrameReceived) { smartPortFrameReceived = false; // do not check the physical ID here again diff --git a/src/main/telemetry/smartport.h b/src/main/telemetry/smartport.h index b24be9070..d50c1fd57 100644 --- a/src/main/telemetry/smartport.h +++ b/src/main/telemetry/smartport.h @@ -15,5 +15,3 @@ void checkSmartPortTelemetryState(void); void configureSmartPortTelemetryPort(void); void freeSmartPortTelemetryPort(void); -bool isSmartPortTimedOut(void); -