From: Gerhard Sittig Date: Tue, 1 Sep 2020 15:06:55 +0000 (+0200) Subject: korad-kaxxxxp: remove obsolete code (clear before read, timeout literal) X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=565c8c354597b1e6013b4eae3ad3f1c9446668e5;p=libsigrok.git korad-kaxxxxp: remove obsolete code (clear before read, timeout literal) The korad response read routine clears the receive buffers, so callers don't have to. This amends commit d2cc60bd4511. The acquisition timeout is handled by common sw_limits support. Remove the no longer referenced literal. This amends commit 3f9b48ae5f35. --- diff --git a/src/hardware/korad-kaxxxxp/api.c b/src/hardware/korad-kaxxxxp/api.c index 78c55b47..ea7c7f34 100644 --- a/src/hardware/korad-kaxxxxp/api.c +++ b/src/hardware/korad-kaxxxxp/api.c @@ -159,7 +159,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (ret < 0) return NULL; - memset(&reply, 0, sizeof(reply)); ret = korad_kaxxxxp_read_chars(serial, len, reply); if (ret < 0) return NULL; diff --git a/src/hardware/korad-kaxxxxp/protocol.c b/src/hardware/korad-kaxxxxp/protocol.c index 2d0cb9b5..1407d51a 100644 --- a/src/hardware/korad-kaxxxxp/protocol.c +++ b/src/hardware/korad-kaxxxxp/protocol.c @@ -21,7 +21,6 @@ #include #include "protocol.h" -#define REQ_TIMEOUT_MS 500 #define DEVICE_PROCESSING_TIME_MS 80 SR_PRIV int korad_kaxxxxp_send_cmd(struct sr_serial_dev_inst *serial, @@ -309,8 +308,6 @@ SR_PRIV int korad_kaxxxxp_get_value(struct sr_serial_dev_inst *serial, return ret; } - reply[count] = 0; - if (value) { sr_atof_ascii((const char *)&reply, value); sr_dbg("value: %f", *value);