]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/asix-sigma/asix-sigma.c
python: classes.i: Declare strings with std::string
[libsigrok.git] / src / hardware / asix-sigma / asix-sigma.c
index 6268747aedc740c11ad21d70dff8f1314df6bc01..957b1d1ac7c7a2098a979be701006fdf392dd80f 100644 (file)
@@ -382,8 +382,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        sdi->driver = di;
 
        for (i = 0; i < ARRAY_SIZE(channel_names); i++)
-               sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
-                                   channel_names[i]);
+               sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_names[i]);
 
        devices = g_slist_append(devices, sdi);
        drvc->instances = g_slist_append(drvc->instances, sdi);
@@ -420,7 +419,7 @@ static int sigma_fpga_init_bitbang(struct dev_context *devc)
                0x01, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01,
                0x01, 0x01,
        };
-       int i, ret, timeout = 10000;
+       int i, ret, timeout = (10 * 1000);
        uint8_t data;
 
        /* Section 2. part 1), do the FPGA suicide. */
@@ -442,7 +441,7 @@ static int sigma_fpga_init_bitbang(struct dev_context *devc)
                if (data & (1 << 5))
                        return 0;
                /* The D6 was not asserted yet, wait a bit. */
-               g_usleep(10000);
+               g_usleep(10 * 1000);
        }
 
        return SR_ERR_TIMEOUT;
@@ -591,7 +590,7 @@ static int upload_firmware(int firmware_idx, struct dev_context *devc)
        }
 
        /* Four times the speed of sigmalogan - Works well. */
-       ret = ftdi_set_baudrate(ftdic, 750000);
+       ret = ftdi_set_baudrate(ftdic, 750 * 1000);
        if (ret < 0) {
                sr_err("ftdi_set_baudrate failed: %s",
                       ftdi_get_error_string(ftdic));
@@ -606,12 +605,12 @@ static int upload_firmware(int firmware_idx, struct dev_context *devc)
        /* Prepare firmware. */
        ret = sigma_fw_2_bitbang(firmware, &buf, &buf_size);
        if (ret != SR_OK) {
-               sr_err("An error occured while reading the firmware: %s",
+               sr_err("An error occurred while reading the firmware: %s",
                       firmware);
                return ret;
        }
 
-       /* Upload firmare. */
+       /* Upload firmware. */
        sr_info("Uploading firmware file '%s'.", firmware);
        sigma_write(buf, buf_size, devc);
 
@@ -884,7 +883,6 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *
        GVariant *gvar;
        GVariantBuilder gvb;
 
-       (void)sdi;
        (void)cg;
 
        switch (key) {
@@ -1082,7 +1080,7 @@ static int decode_chunk_ts(struct sigma_dram_line *dram_line,
                                             trigger_event);
                }
 
-               /* Find in which cluster the trigger occured. */
+               /* Find in which cluster the trigger occurred. */
                trigger_cluster = trigger_event / EVENTS_PER_CLUSTER;
        }
 
@@ -1367,7 +1365,7 @@ static int build_basic_trigger(struct triggerlut *lut, struct dev_context *devc)
 
        memset(lut, 0, sizeof(struct triggerlut));
 
-       /* Contant for simple triggers. */
+       /* Constant for simple triggers. */
        lut->m4 = 0xa000;
 
        /* Value/mask trigger support. */