X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fasix-sigma%2Fapi.c;h=89783456c5bbe416ed5fcc8c3945eb9093400181;hb=2142a79b53e7fb2d9d050c382b624820601c1bd6;hp=042793a8961c8e52c5ee7d1acb094a01ab1c91f9;hpb=efad7cccec8ab00043939b36de950ba2ced15f85;p=libsigrok.git diff --git a/src/hardware/asix-sigma/api.c b/src/hardware/asix-sigma/api.c index 042793a8..89783456 100644 --- a/src/hardware/asix-sigma/api.c +++ b/src/hardware/asix-sigma/api.c @@ -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; }