From b6583a1eb5a651da0d70eca2d6e70329cd874044 Mon Sep 17 00:00:00 2001 From: fishpepper Date: Fri, 25 Nov 2016 11:16:45 +0100 Subject: [PATCH] fixing serial passthrough on opened ports --- src/main/io/serial_cli.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index 58697228a..3e2d97373 100755 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -1441,6 +1441,12 @@ static void cliSerialPassthrough(char *cmdline) passThroughPort->mode, mode); serialSetMode(passThroughPort, mode); } + // If this port has a rx callback associated we need to remove it now. + // Otherwise no data will be pushed in the serial port buffer! + if (passThroughPort->rxCallback) { + printf("Removing rxCallback from port\r\n"); + passThroughPort->rxCallback = 0; + } } printf("Relaying data to device on port %d, Reset your board to exit "