unsigned int i;
if ((transfer->buffer != (unsigned char *)&devc->cmd_pkt) &&
- (transfer->buffer != devc->buffer)) {
+ (transfer->buffer != devc->buf)) {
g_free(transfer->buffer);
}
struct sr_dev_inst *const sdi = transfer->user_data;
struct dev_context *const devc = sdi->priv;
uint32_t max_samples = transfer->actual_length / sizeof(uint32_t);
- uint32_t *buffer;
+ uint32_t *buf;
uint32_t num_samples;
/*
return;
}
- buffer = (uint32_t *)transfer->buffer;
+ buf = (uint32_t *)transfer->buffer;
num_samples = MIN(devc->remaining_samples, max_samples);
devc->remaining_samples -= num_samples;
- send_data(sdi, buffer, num_samples);
+ send_data(sdi, buf, num_samples);
sr_dbg("Remaining: %d %08X %08X.", devc->remaining_samples,
- buffer[0], buffer[1]);
+ buf[0], buf[1]);
/* Close data receiving. */
if (devc->remaining_samples == 0) {
- if (buffer[num_samples] != H4032L_END_PACKET_MAGIC)
+ if (buf[num_samples] != H4032L_END_PACKET_MAGIC)
sr_err("Mismatch magic number of end poll.");
abort_acquisition(devc);
struct sr_usb_dev_inst *usb = sdi->conn;
gboolean cmd = FALSE;
uint32_t max_samples = transfer->actual_length / sizeof(uint32_t);
- uint32_t *buffer;
+ uint32_t *buf;
struct h4032l_status_packet *status;
uint32_t num_samples;
int ret;
if (transfer->status != LIBUSB_TRANSFER_COMPLETED)
sr_dbg("%s error: %d.", __func__, transfer->status);
- buffer = (uint32_t *)transfer->buffer;
+ buf = (uint32_t *)transfer->buffer;
switch (devc->status) {
case H4032L_STATUS_IDLE:
break;
case H4032L_STATUS_FIRST_TRANSFER:
/* Drop packets until H4032L_START_PACKET_MAGIC. */
- if (buffer[0] != H4032L_START_PACKET_MAGIC) {
+ if (buf[0] != H4032L_START_PACKET_MAGIC) {
sr_dbg("Mismatch magic number of start poll.");
break;
}
devc->status = H4032L_STATUS_TRANSFER;
max_samples--;
- buffer++;
+ buf++;
/* Fallthrough. */
case H4032L_STATUS_TRANSFER:
num_samples = MIN(devc->remaining_samples, max_samples);
devc->remaining_samples -= num_samples;
- send_data(sdi, buffer, num_samples);
+ send_data(sdi, buf, num_samples);
sr_dbg("Remaining: %d %08X %08X.", devc->remaining_samples,
- buffer[0], buffer[1]);
+ buf[0], buf[1]);
break;
}
sr_dbg("Poll: %d.", devc->status);
libusb_fill_bulk_transfer(transfer, usb->devhdl,
6 | LIBUSB_ENDPOINT_IN,
- devc->buffer, ARRAY_SIZE(devc->buffer),
+ devc->buf, ARRAY_SIZE(devc->buf),
h4032l_usb_callback,
(void *)sdi, H4032L_USB_TIMEOUT);
}
struct dev_context *devc = sdi->priv;
struct sr_usb_dev_inst *usb = sdi->conn;
struct libusb_transfer *transfer;
- uint8_t *buffer;
+ uint8_t *buf;
unsigned int num_transfers;
unsigned int i;
int ret;
devc->num_transfers = num_transfers;
for (i = 0; i < num_transfers; i++) {
- buffer = g_malloc(H4032L_DATA_BUFFER_SIZE);
+ buf = g_malloc(H4032L_DATA_BUFFER_SIZE);
transfer = libusb_alloc_transfer(0);
libusb_fill_bulk_transfer(transfer, usb->devhdl,
6 | LIBUSB_ENDPOINT_IN,
- buffer, H4032L_DATA_BUFFER_SIZE,
+ buf, H4032L_DATA_BUFFER_SIZE,
h4032l_data_transfer_callback,
(void *)sdi, H4032L_USB_TIMEOUT);
sr_err("Failed to submit transfer: %s.",
libusb_error_name(ret));
libusb_free_transfer(transfer);
- g_free(buffer);
+ g_free(buf);
abort_acquisition(devc);
return SR_ERR;
}
struct dev_context *devc = sdi->priv;
struct sr_usb_dev_inst *usb = sdi->conn;
struct libusb_transfer *transfer;
- unsigned char buffer[] = {0x0f, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ unsigned char buf[] = {0x0f, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
int ret;
/* Send reset command to arm the logic analyzer. */
if ((ret = libusb_control_transfer(usb->devhdl,
LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_OUT, CMD_RESET,
- 0x00, 0x00, buffer, ARRAY_SIZE(buffer), H4032L_USB_TIMEOUT)) < 0) {
+ 0x00, 0x00, buf, ARRAY_SIZE(buf), H4032L_USB_TIMEOUT)) < 0) {
sr_err("Failed to send vendor request %s.",
libusb_error_name(ret));
return SR_ERR;
/* Attempt to get FGPA version. */
for (i = 0; i < 10; i++) {
if ((ret = libusb_bulk_transfer(usb->devhdl,
- 6 | LIBUSB_ENDPOINT_IN, devc->buffer,
- ARRAY_SIZE(devc->buffer), &transferred, H4032L_USB_TIMEOUT)) < 0) {
+ 6 | LIBUSB_ENDPOINT_IN, devc->buf,
+ ARRAY_SIZE(devc->buf), &transferred, H4032L_USB_TIMEOUT)) < 0) {
sr_err("Unable to receive FPGA version: %s.",
libusb_error_name(ret));
return SR_ERR;
}
- status = (struct h4032l_status_packet *)devc->buffer;
+ status = (struct h4032l_status_packet *)devc->buf;
if (status->magic == H4032L_STATUS_PACKET_MAGIC) {
sr_dbg("FPGA version: 0x%x.", status->fpga_version);
devc->fpga_version = status->fpga_version;