X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fikalogic-scanalogic2%2Fprotocol.c;h=87218de57eb09d5f057b673f9f142f988fb477ff;hb=51b294cd013db9d4d15f713c9ed576c343e685d6;hp=29e374bc05479febd4ed001a98b1571451456258;hpb=fb8d593cfea094dd50d74873c8c00445eb0a040f;p=libsigrok.git diff --git a/hardware/ikalogic-scanalogic2/protocol.c b/hardware/ikalogic-scanalogic2/protocol.c index 29e374bc..87218de5 100644 --- a/hardware/ikalogic-scanalogic2/protocol.c +++ b/hardware/ikalogic-scanalogic2/protocol.c @@ -26,17 +26,14 @@ extern uint64_t sl2_samplerates[NUM_SAMPLERATES]; static void stop_acquisition(struct sr_dev_inst *sdi) { + struct drv_context *drvc = sdi->driver->priv; struct dev_context *devc; struct sr_datafeed_packet packet; - unsigned int i; devc = sdi->priv; /* Remove USB file descriptors from polling. */ - for (i = 0; i < devc->num_usbfd; i++) - sr_source_remove(devc->usbfd[i]); - - g_free(devc->usbfd); + usb_source_remove(drvc->sr_ctx); packet.type = SR_DF_END; sr_session_send(devc->cb_data, &packet); @@ -46,17 +43,14 @@ static void stop_acquisition(struct sr_dev_inst *sdi) static void abort_acquisition(struct sr_dev_inst *sdi) { + struct drv_context *drvc = sdi->driver->priv; struct dev_context *devc; struct sr_datafeed_packet packet; - unsigned int i; devc = sdi->priv; /* Remove USB file descriptors from polling. */ - for (i = 0; i < devc->num_usbfd; i++) - sr_source_remove(devc->usbfd[i]); - - g_free(devc->usbfd); + usb_source_remove(drvc->sr_ctx); packet.type = SR_DF_END; sr_session_send(devc->cb_data, &packet); @@ -127,8 +121,8 @@ static void process_sample_data(const struct sr_dev_inst *sdi) /* * Adjust the position of the first sample to be * processed because possibly more samples than - * necessary might have been aquired. This is because - * the number of aquired samples is always rounded up + * necessary might have been acquired. This is because + * the number of acquired samples is always rounded up * to a multiple of 8. */ k = k - (devc->pre_trigger_bytes * 8) +