1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

windows: Await completion of previous write before changing config.

This commit is contained in:
Martin Ling 2017-07-03 20:56:21 +01:00 committed by Uwe Hermann
parent 55ab7e0b6b
commit 6bd6a8b520

View 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); DEBUG_FMT("Setting configuration for port %s", port->name);
#ifdef _WIN32 #ifdef _WIN32
TRY(await_write_completion(port));
if (config->baudrate >= 0) { if (config->baudrate >= 0) {
for (i = 0; i < NUM_STD_BAUDRATES; i++) { for (i = 0; i < NUM_STD_BAUDRATES; i++) {
if (config->baudrate == std_baudrates[i].value) { if (config->baudrate == std_baudrates[i].value) {