]> sigrok.org Git - libsigrok.git/commitdiff
atten-pps3xxx: Make serial write call block.
authorMartin Ling <redacted>
Tue, 16 Sep 2014 01:36:42 +0000 (02:36 +0100)
committerUwe Hermann <redacted>
Wed, 24 Sep 2014 21:30:00 +0000 (23:30 +0200)
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.

src/hardware/atten-pps3xxx/protocol.c

index ed4d5505e6a17d7ef8edf469cd8192e20b987e07..66ecb7a28ff2cde835de7db59c122e3685283963 100644 (file)
@@ -86,7 +86,7 @@ SR_PRIV void send_packet(const struct sr_dev_inst *sdi, uint8_t *packet)
        struct sr_serial_dev_inst *serial;
 
        serial = sdi->conn;
-       if (serial_write(serial, packet, PACKET_SIZE) == -1)
+       if (serial_write_blocking(serial, packet, PACKET_SIZE) == -1)
                sr_dbg("Failed to send packet: %s", strerror(errno));
        dump_packet("sent", packet);
 }