From: Martin Ling Date: Mon, 3 Jul 2017 19:56:21 +0000 (+0100) Subject: windows: Await completion of previous write before changing config. X-Git-Tag: libserialport-0.1.2~88 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6bd6a8b5203633baf5593eae72438a180c77b489;p=libserialport.git windows: Await completion of previous write before changing config. --- diff --git a/serialport.c b/serialport.c index 4493170..49cba74 100644 --- a/serialport.c +++ b/serialport.c @@ -1881,6 +1881,9 @@ static enum sp_return set_config(struct sp_port *port, struct port_data *data, DEBUG_FMT("Setting configuration for port %s", port->name); #ifdef _WIN32 + + TRY(await_write_completion(port)); + if (config->baudrate >= 0) { for (i = 0; i < NUM_STD_BAUDRATES; i++) { if (config->baudrate == std_baudrates[i].value) {