]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/cem-dt-885x/api.c
Rename SR_CONF_OUTPUT_* to SR_CONF_*.
[libsigrok.git] / src / hardware / cem-dt-885x / api.c
index 1e4998028294bd1532920f84c25a72ec58ea6fd1..a30b5b778d9e9be015fe17d1b7955cb30041063b 100644 (file)
@@ -21,8 +21,9 @@
 #include "protocol.h"
 
 #define SERIALCOMM "9600/8n1"
+
 /* 23ms is the longest interval between tokens. */
-#define MAX_SCAN_TIME 25 * 1000
+#define MAX_SCAN_TIME_US (25 * 1000)
 
 static const uint32_t scanopts[] = {
        SR_CONF_CONN,
@@ -66,8 +67,8 @@ static const char *data_sources[] = {
        "Live",
        "Memory",
 };
-SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info;
 
+SR_PRIV struct sr_dev_driver cem_dt_885x_driver_info;
 
 static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
 {
@@ -103,7 +104,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        devices = NULL;
        drvc = di->priv;
        start = g_get_monotonic_time();
-       while (g_get_monotonic_time() - start < MAX_SCAN_TIME) {
+       while (g_get_monotonic_time() - start < MAX_SCAN_TIME_US) {
                if (serial_read_nonblocking(serial, &c, 1) == 1 && c == 0xa5) {
                        /* Found one. */
                        sdi = g_malloc0(sizeof(struct sr_dev_inst));
@@ -348,6 +349,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
                case SR_CONF_DEVICE_OPTIONS:
                        *data = g_variant_new_fixed_array(G_VARIANT_TYPE_UINT32,
                                        devopts, ARRAY_SIZE(devopts), sizeof(uint32_t));
+                       break;
                case SR_CONF_SPL_WEIGHT_FREQ:
                        *data = g_variant_new_strv(weight_freq, ARRAY_SIZE(weight_freq));
                        break;