]> sigrok.org Git - libserialport.git/commitdiff
windows: Await completion of previous write before changing config.
authorMartin Ling <redacted>
Mon, 3 Jul 2017 19:56:21 +0000 (20:56 +0100)
committerUwe Hermann <redacted>
Sat, 28 Dec 2019 19:43:22 +0000 (20:43 +0100)
serialport.c

index 449317052704e87a5f8038b0f50ea1399d097115..49cba74a2b2d8a6081ccb8b5825eaafbea2eb878 100644 (file)
@@ -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) {