X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Flascar-el-usb%2Fapi.c;h=4d9ae81dfb4aa4fddab39c83eb16aa9386c22544;hb=d586a7f4bd0d83a1e432d5ca1ee63af94bdb4e13;hp=67efcf1a2489376982ffe6490040dcfa65aadc68;hpb=dcd438ee3523098201c7937e75e55775da3b506f;p=libsigrok.git diff --git a/src/hardware/lascar-el-usb/api.c b/src/hardware/lascar-el-usb/api.c index 67efcf1a..4d9ae81d 100644 --- a/src/hardware/lascar-el-usb/api.c +++ b/src/hardware/lascar-el-usb/api.c @@ -252,7 +252,7 @@ static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst * return SR_OK; } -static void mark_xfer(struct libusb_transfer *xfer) +static void LIBUSB_CALL mark_xfer(struct libusb_transfer *xfer) { if (xfer->status == LIBUSB_TRANSFER_COMPLETED) @@ -300,11 +300,11 @@ static int lascar_proc_config(const struct sr_dev_inst *sdi) devc->temp_unit = devc->config[0x2e] | (devc->config[0x2f] << 8); if (devc->temp_unit != 0 && devc->temp_unit != 1) { sr_dbg("invalid temperature unit %d", devc->temp_unit); - /* Default to Celcius, we're all adults here. */ + /* Default to Celsius, we're all adults here. */ devc->temp_unit = 0; } else sr_dbg("temperature unit is %s", devc->temp_unit - ? "Fahrenheit" : "Celcius"); + ? "Fahrenheit" : "Celsius"); break; case LOG_CO: devc->sample_size = 2; @@ -390,7 +390,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) ; libusb_fill_bulk_transfer(xfer_in, usb->devhdl, LASCAR_EP_IN, - resp, sizeof(resp), mark_xfer, 0, 10000); + resp, sizeof(resp), mark_xfer, 0, BULK_XFER_TIMEOUT); if (libusb_submit_transfer(xfer_in) != 0) { libusb_free_transfer(xfer_in); libusb_free_transfer(xfer_out); @@ -411,7 +411,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) tv.tv_sec = 0; tv.tv_usec = 0; while (!xfer_in->user_data || !xfer_out->user_data) { - g_usleep(5000); + g_usleep(SLEEP_US_LONG); libusb_handle_events_timeout(drvc->sr_ctx->libusb_ctx, &tv); } if (xfer_in->user_data != GINT_TO_POINTER(1) || @@ -433,7 +433,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) usb_source_add(sdi->session, drvc->sr_ctx, 100, lascar_el_usb_handle_events, (void *)sdi); - buf = g_try_malloc(4096); + buf = g_malloc(4096); libusb_fill_bulk_transfer(xfer_in, usb->devhdl, LASCAR_EP_IN, buf, 4096, lascar_el_usb_receive_transfer, cb_data, 100); if ((ret = libusb_submit_transfer(xfer_in) != 0)) {