From 31c8c21a79fb4000eaec9e2f8eb4658eaa928456 Mon Sep 17 00:00:00 2001 From: Petr Ledvina Date: Wed, 19 Nov 2014 17:46:31 +0100 Subject: [PATCH] Enable TX when entering gpspassthrough --- src/main/io/gps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/io/gps.c b/src/main/io/gps.c index bdffd5b1e..39bde4ed1 100644 --- a/src/main/io/gps.c +++ b/src/main/io/gps.c @@ -190,7 +190,7 @@ void gpsInit(serialConfig_t *initialSerialConfig, gpsConfig_t *initialGpsConfig) portMode_t mode = MODE_RXTX; // only RX is needed for NMEA-style GPS if (gpsConfig->provider == GPS_NMEA) - mode = MODE_RX; + mode &= ~MODE_TX; // no callback - buffer will be consumed in gpsThread() gpsPort = openSerialPort(FUNCTION_GPS, NULL, gpsInitData[gpsData.baudrateIndex].baudrate, mode, SERIAL_NOT_INVERTED); @@ -870,6 +870,8 @@ gpsEnablePassthroughResult_e gpsEnablePassthrough(void) return GPS_PASSTHROUGH_NO_SERIAL_PORT; } } + if(!(gpsPort->mode & MODE_TX)) + serialSetMode(gpsPort, gpsPort->mode | MODE_TX); LED0_OFF; LED1_OFF;