X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fapi.c;h=ca050bf633700f438677d2aa8014ecdd99802ad3;hb=8dc423b033678508ec08d7c473d883d4b3a58178;hp=b9da2f98ab55891d5f31c74b747261dcde595dc4;hpb=c2fdcc25a47c4c8f25e3ea96ea36a674a151e839;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index b9da2f98..ca050bf6 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -75,12 +75,9 @@ static const uint64_t samplerates[] = { SR_HZ(1), }; -SR_PRIV struct sr_dev_driver p_ols_driver_info; - 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; @@ -89,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. */ @@ -179,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); @@ -673,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, @@ -697,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; } @@ -720,3 +714,4 @@ SR_PRIV struct sr_dev_driver p_ols_driver_info = { .dev_acquisition_stop = dev_acquisition_stop, .context = NULL, }; +SR_REGISTER_DEV_DRIVER(p_ols_driver_info);