From: Paul Kasemir Date: Sat, 14 Nov 2020 08:18:54 +0000 (-0700) Subject: link-mso19: Remove stale code to get driver to compile X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=89479aa4e2b7ecf0d680b207bc171f07d5b0d7bc;p=libsigrok.git link-mso19: Remove stale code to get driver to compile serial_write() doesn't exist anymore, for example. --- diff --git a/src/hardware/link-mso19/api.c b/src/hardware/link-mso19/api.c index 1209c64f..d26dbda6 100644 --- a/src/hardware/link-mso19/api.c +++ b/src/hardware/link-mso19/api.c @@ -31,7 +31,6 @@ static const uint32_t drvopts[] = { static const uint32_t devopts[] = { SR_CONF_LIMIT_SAMPLES | SR_CONF_SET, SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_TRIGGER_TYPE | SR_CONF_LIST, SR_CONF_TRIGGER_SLOPE | SR_CONF_SET, SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_SET, SR_CONF_CAPTURE_RATIO | SR_CONF_SET, @@ -66,7 +65,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) const char *serialcomm = NULL; GSList *l; struct sr_config *src; - struct udev *udev; int chtype; for (l = options; l; l = l->next) { @@ -85,6 +83,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (!serialcomm) serialcomm = SERIALCOMM; + /* udev = udev_new(); if (!udev) { sr_err("Failed to initialize udev."); @@ -174,6 +173,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_channel_new(sdi, i, chtype, TRUE, channel_names[i]); } } + */ return std_scan_complete(di, devices); } @@ -238,6 +238,7 @@ static int config_set(uint32_t key, GVariant *data, const char *slope; int trigger_pos; double pos; + int idx; (void)cg; @@ -289,9 +290,6 @@ static int config_list(uint32_t key, GVariant **data, case SR_CONF_SAMPLERATE: *data = std_gvar_samplerates_steps(ARRAY_AND_SIZE(samplerates)); break; - case SR_CONF_TRIGGER_TYPE: - *data = g_variant_new_string(TRIGGER_TYPE); - break; default: return SR_ERR_NA; } diff --git a/src/hardware/link-mso19/protocol.c b/src/hardware/link-mso19/protocol.c index f3e624eb..cce62904 100644 --- a/src/hardware/link-mso19/protocol.c +++ b/src/hardware/link-mso19/protocol.c @@ -39,9 +39,6 @@ SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial, ret = SR_ERR; - if (serial->fd < 0) - goto ret; - buf = g_malloc(s); p = buf; @@ -56,7 +53,7 @@ SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial, w = 0; while (w < s) { - ret = serial_write(serial, buf + w, s - w); + ret = serial_write_blocking(serial, buf + w, s - w, 10); if (ret < 0) { ret = SR_ERR; goto free; @@ -66,7 +63,6 @@ SR_PRIV int mso_send_control_message(struct sr_serial_dev_inst *serial, ret = SR_OK; free: g_free(buf); -ret: return ret; } @@ -337,7 +333,7 @@ SR_PRIV int mso_check_trigger(struct sr_serial_dev_inst *serial, uint8_t *info) return ret; uint8_t buf = 0; - if (serial_read(serial, &buf, 1) != 1) /* FIXME: Need timeout */ + if (serial_read_blocking(serial, &buf, 1, 10) != 1) ret = SR_ERR; if (!info) *info = buf; @@ -368,7 +364,7 @@ SR_PRIV int mso_receive_data(int fd, int revents, void *cb_data) if (!devc) return TRUE; - s = serial_read(devc->serial, in, sizeof(in)); + s = serial_read_blocking(devc->serial, in, sizeof(in), 10); if (s <= 0) return FALSE; @@ -439,6 +435,7 @@ SR_PRIV int mso_configure_channels(const struct sr_dev_inst *sdi) devc->trigger_chan = 3; //LA combination trigger devc->use_trigger = FALSE; + /* for (l = sdi->channels; l; l = l->next) { ch = (struct sr_channel *)l->data; if (ch->enabled == FALSE) @@ -456,6 +453,7 @@ SR_PRIV int mso_configure_channels(const struct sr_dev_inst *sdi) devc->la_trigger |= channel_bit; } } + */ return SR_OK; } diff --git a/src/hardware/link-mso19/protocol.h b/src/hardware/link-mso19/protocol.h index f3e7b285..3341f2fb 100644 --- a/src/hardware/link-mso19/protocol.h +++ b/src/hardware/link-mso19/protocol.h @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "libsigrok-internal.h" @@ -36,7 +35,6 @@ #define USB_PRODUCT "f190" #define NUM_TRIGGER_STAGES 4 -#define TRIGGER_TYPE "01" //the first r/f is used for the whole group #define SERIALCOMM "460800/8n1/flow=2" #define SERIALCONN "/dev/ttyUSB0" #define CLOCK_RATE SR_MHZ(100)