]> sigrok.org Git - libsigrok.git/blobdiff - hardware/asix-sigma/asix-sigma.c
alsa: Find supported samplerates during device scan
[libsigrok.git] / hardware / asix-sigma / asix-sigma.c
index 7ae16bc997c195b5d5e6bb4a7646649e4d68cff5..8ff2e159101a79386603f6e7c1a1a83895c3ccb7 100644 (file)
@@ -64,22 +64,8 @@ static const uint64_t supported_samplerates[] = {
  * (the cable has two additional GND pins, and a TI and TO pin)
  */
 static const char *probe_names[NUM_PROBES + 1] = {
-       "1",
-       "2",
-       "3",
-       "4",
-       "5",
-       "6",
-       "7",
-       "8",
-       "9",
-       "10",
-       "11",
-       "12",
-       "13",
-       "14",
-       "15",
-       "16",
+       "1", "2", "3", "4", "5", "6", "7", "8",
+       "9", "10", "11", "12", "13", "14", "15", "16",
        NULL,
 };
 
@@ -662,6 +648,8 @@ static int set_samplerate(const struct sr_dev_inst *sdi, uint64_t samplerate)
        int i, ret;
        struct dev_context *devc = sdi->priv;
 
+       ret = SR_OK;
+
        for (i = 0; supported_samplerates[i]; i++) {
                if (supported_samplerates[i] == samplerate)
                        break;
@@ -1067,7 +1055,9 @@ static int receive_data(int fd, int revents, void *cb_data)
                else
                        hw_dev_acquisition_stop(sdi, sdi);
 
-       } else if (devc->state.state == SIGMA_DOWNLOAD) {
+       }
+
+       if (devc->state.state == SIGMA_DOWNLOAD) {
                if (devc->state.chunks_downloaded >= numchunks) {
                        /* End of samples. */
                        packet.type = SR_DF_END;
@@ -1290,7 +1280,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        struct sr_datafeed_meta_logic meta;
        struct clockselect_50 clockselect;
        int frac, triggerpin, ret;
-       uint8_t triggerselect;
+       uint8_t triggerselect = 0;
        struct triggerinout triggerinout_conf;
        struct triggerlut lut;