X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fpipistrello-ols%2Fprotocol.c;h=dbe79c6a5a385283e5912d1b12231ab40cc6565c;hb=3553451f1ed45d92bff11952cb131ac6a891b69f;hp=421934b2318d3bd2cea53927cea4b0150e937610;hpb=15a5bfe4815f9991a9bb532c05d6244a1818a0e4;p=libsigrok.git diff --git a/src/hardware/pipistrello-ols/protocol.c b/src/hardware/pipistrello-ols/protocol.c index 421934b2..dbe79c6a 100644 --- a/src/hardware/pipistrello-ols/protocol.c +++ b/src/hardware/pipistrello-ols/protocol.c @@ -80,7 +80,6 @@ SR_PRIV int p_ols_open(struct dev_context *devc) ftdi_get_error_string(devc->ftdic)); return SR_ERR; } - sr_dbg("FTDI chip interface B set successfully."); /* Check for the device and temporarily open it. */ ret = ftdi_usb_open_desc(devc->ftdic, USB_VENDOR_ID, USB_DEVICE_ID, @@ -92,7 +91,6 @@ SR_PRIV int p_ols_open(struct dev_context *devc) ftdi_get_error_string(devc->ftdic)); return SR_ERR; } - sr_dbg("FTDI device opened successfully."); /* Purge RX/TX buffers in the FTDI chip. */ if ((ret = ftdi_usb_purge_buffers(devc->ftdic)) < 0) { @@ -100,7 +98,6 @@ SR_PRIV int p_ols_open(struct dev_context *devc) ret, ftdi_get_error_string(devc->ftdic)); goto err_open_close_ftdic; } - sr_dbg("FTDI chip buffers purged successfully."); /* Reset the FTDI bitmode. */ ret = ftdi_set_bitmode(devc->ftdic, 0xff, BITMODE_RESET); @@ -109,7 +106,6 @@ SR_PRIV int p_ols_open(struct dev_context *devc) ret, ftdi_get_error_string(devc->ftdic)); goto err_open_close_ftdic; } - sr_dbg("FTDI chip bitmode reset successfully."); /* Set the FTDI latency timer to 16. */ ret = ftdi_set_latency_timer(devc->ftdic, 16); @@ -118,7 +114,6 @@ SR_PRIV int p_ols_open(struct dev_context *devc) ret, ftdi_get_error_string(devc->ftdic)); goto err_open_close_ftdic; } - sr_dbg("FTDI chip latency timer set successfully."); /* Set the FTDI read data chunk size to 64kB. */ ret = ftdi_read_data_set_chunksize(devc->ftdic, 64 * 1024); @@ -127,12 +122,12 @@ SR_PRIV int p_ols_open(struct dev_context *devc) ret, ftdi_get_error_string(devc->ftdic)); goto err_open_close_ftdic; } - sr_dbg("FTDI chip read data chunk size set successfully."); - + return SR_OK; err_open_close_ftdic: ftdi_usb_close(devc->ftdic); + return SR_ERR; } @@ -424,7 +419,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) if (bytes_read < 0) { sr_err("Failed to read FTDI data (%d): %s.", bytes_read, ftdi_get_error_string(devc->ftdic)); - sdi->driver->dev_acquisition_stop(sdi); + sr_dev_acquisition_stop(sdi); return FALSE; } if (bytes_read == 0) { @@ -443,7 +438,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) sr_spew("Received byte 0x%.2x.", byte); if ((devc->flag_reg & FLAG_DEMUX) && (devc->flag_reg & FLAG_RLE)) { - /* RLE in demux mode must be processed differently + /* RLE in demux mode must be processed differently * since in this case the RLE encoder is operating on pairs of samples. */ if (devc->num_bytes == num_channels * 2) { @@ -499,7 +494,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) * sample. */ devc->tmp_sample[i] = devc->sample[j++]; - } + } } /* Clear out the most significant bit of the sample */ devc->tmp_sample[devc->num_bytes - 1] &= 0x7f; @@ -517,7 +512,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) * sample. */ devc->tmp_sample2[i] = devc->sample[j++]; - } + } } /* Clear out the most significant bit of the sample */ devc->tmp_sample2[devc->num_bytes - 1] &= 0x7f; @@ -597,7 +592,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) * sample. */ devc->tmp_sample[i] = devc->sample[j++]; - } + } } memcpy(devc->sample, devc->tmp_sample, 4); sr_spew("Expanded sample: 0x%.8x.", sample); @@ -672,7 +667,7 @@ SR_PRIV int p_ols_receive_data(int fd, int revents, void *cb_data) } g_free(devc->raw_sample_buf); - sdi->driver->dev_acquisition_stop(sdi); + sr_dev_acquisition_stop(sdi); } return TRUE;