X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=269b99f7c2c8287ac6173d81c37dbbd86169019b;hb=cf398cc0589fe37589c7e6750cf6b735b77494df;hp=eb81c781b5388116da19ab23207873a994871f5a;hpb=dd5c48a6d567a3cac62c4b0058588273bbeea171;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index eb81c781..269b99f7 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -78,7 +78,6 @@ static const uint64_t samplerates[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { struct sr_dev_inst *sdi; - struct drv_context *drvc; struct dev_context *devc; GSList *devices; int ret, i; @@ -87,8 +86,6 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) (void)options; - drvc = di->context; - devices = NULL; /* Allocate memory for our private device context. */ @@ -116,7 +113,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) if (p_ols_open(devc) != SR_OK) { goto err_free_ftdic; } - + /* The discovery procedure is like this: first send the Reset * command (0x00) 5 times, since the device could be anywhere * in a 5-byte command. Then send the ID command (0x02). @@ -177,10 +174,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sr_dbg("Failed to set default samplerate (%"PRIu64").", DEFAULT_SAMPLERATE); - drvc->instances = g_slist_append(drvc->instances, sdi); devices = g_slist_append(devices, sdi); - return devices; + return std_scan_complete(di, devices); err_close_ftdic: p_ols_close(devc); @@ -646,8 +642,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) sr_dbg("flag_reg = %x", devc->flag_reg); /* - * In demux mode the OLS is processing two 8-bit or 16-bit samples - * in parallel and for this to work the lower two bits of the four + * In demux mode the OLS is processing two 8-bit or 16-bit samples + * in parallel and for this to work the lower two bits of the four * "channel_disable" bits must be replicated to the upper two bits. */ flag_tmp = devc->flag_reg; @@ -671,7 +667,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) devc->cnt_bytes = devc->cnt_samples = devc->cnt_samples_rle = 0; memset(devc->sample, 0, 4); - std_session_send_df_header(sdi, LOG_PREFIX); + std_session_send_df_header(sdi); /* Hook up a dummy handler to receive data from the device. */ sr_session_source_add(sdi->session, -1, 0, 10, p_ols_receive_data, @@ -695,7 +691,7 @@ static int dev_acquisition_stop(struct sr_dev_inst *sdi) sr_session_source_remove(sdi->session, -1); - std_session_send_df_end(sdi, LOG_PREFIX); + std_session_send_df_end(sdi); return SR_OK; }