]> sigrok.org Git - libsigrok.git/commitdiff
link-mso19: Remove stale code to get driver to compile
authorPaul Kasemir <redacted>
Sat, 14 Nov 2020 08:18:54 +0000 (01:18 -0700)
committerSoeren Apel <redacted>
Wed, 16 Oct 2024 22:00:00 +0000 (00:00 +0200)
serial_write() doesn't exist anymore, for example.

src/hardware/link-mso19/api.c
src/hardware/link-mso19/protocol.c
src/hardware/link-mso19/protocol.h

index 1209c64f8cb91e22f2cc2ca20813fed857e20bd8..d26dbda681a38f7a95cf918146c3c479fdb1ac3a 100644 (file)
@@ -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;
        }
index f3e624eb442545fc3e3a51157ac0bb712c68fb15..cce6290464d0793f41fcd54999b71df07fcceb90 100644 (file)
@@ -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;
 }
index f3e7b285dbf26468626ea49565207808667161b6..3341f2fb5df251ec748aedfe6d9a811e9db3581b 100644 (file)
@@ -26,7 +26,6 @@
 #include <stdint.h>
 #include <string.h>
 #include <glib.h>
-#include <libudev.h>
 #include <libsigrok/libsigrok.h>
 #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)