]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/asix-sigma/api.c
input/csv: introduce column-formats option (flexible logic import)
[libsigrok.git] / src / hardware / asix-sigma / api.c
index 042793a8961c8e52c5ee7d1acb094a01ab1c91f9..89783456c5bbe416ed5fcc8c3945eb9093400181 100644 (file)
@@ -226,7 +226,7 @@ static int config_list(uint32_t key, GVariant **data,
 {
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
-               return STD_CONFIG_LIST(key, data, sdi, cg, NULL, drvopts, devopts);
+               return STD_CONFIG_LIST(key, data, sdi, cg, NO_OPTS, drvopts, devopts);
        case SR_CONF_SAMPLERATE:
                *data = std_gvar_samplerates(samplerates, samplerates_count);
                break;
@@ -363,9 +363,20 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        devc = sdi->priv;
-       devc->state.state = SIGMA_IDLE;
 
-       sr_session_source_remove(sdi->session, -1);
+       /*
+        * When acquisition is currently running, keep the receive
+        * routine registered and have it stop the acquisition upon the
+        * next invocation. Else unregister the receive routine here
+        * already. The detour is required to have sample data retrieved
+        * for forced acquisition stops.
+        */
+       if (devc->state.state == SIGMA_CAPTURE) {
+               devc->state.state = SIGMA_STOPPING;
+       } else {
+               devc->state.state = SIGMA_IDLE;
+               sr_session_source_remove(sdi->session, -1);
+       }
 
        return SR_OK;
 }