From: Uwe Hermann Date: Tue, 5 Jun 2018 21:56:30 +0000 (+0200) Subject: hantek-4032l: Rename number_samples to num_samples. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7b9387b8f0e9ea0055b168418df2fadfce8da3da;p=libsigrok.git hantek-4032l: Rename number_samples to num_samples. --- diff --git a/src/hardware/hantek-4032l/api.c b/src/hardware/hantek-4032l/api.c index d0cbbd54..542e6c4a 100644 --- a/src/hardware/hantek-4032l/api.c +++ b/src/hardware/hantek-4032l/api.c @@ -387,7 +387,7 @@ static int config_set(uint32_t key, GVariant *data, int idx; struct dev_context *devc = sdi->priv; struct h4032l_cmd_pkt *cmd_pkt = &devc->cmd_pkt; - uint64_t sample_rate, number_samples; + uint64_t sample_rate, num_samples; double low, high; switch (key) { @@ -406,16 +406,16 @@ static int config_set(uint32_t key, GVariant *data, devc->capture_ratio = g_variant_get_uint64(data); break; case SR_CONF_LIMIT_SAMPLES: - number_samples = g_variant_get_uint64(data); - number_samples += 511; - number_samples &= 0xfffffe00; - if (number_samples < H4043L_NUM_SAMPLES_MIN || - number_samples > H4032L_NUM_SAMPLES_MAX) { + num_samples = g_variant_get_uint64(data); + num_samples += 511; + num_samples &= 0xfffffe00; + if (num_samples < H4043L_NUM_SAMPLES_MIN || + num_samples > H4032L_NUM_SAMPLES_MAX) { sr_err("Invalid sample range 2k...64M: %" - PRIu64 ".", number_samples); + PRIu64 ".", num_samples); return SR_ERR; } - cmd_pkt->sample_size = number_samples; + cmd_pkt->sample_size = num_samples; break; case SR_CONF_VOLTAGE_THRESHOLD: if (!cg) diff --git a/src/hardware/hantek-4032l/protocol.c b/src/hardware/hantek-4032l/protocol.c index a3b41858..1021d8fd 100644 --- a/src/hardware/hantek-4032l/protocol.c +++ b/src/hardware/hantek-4032l/protocol.c @@ -165,7 +165,7 @@ void LIBUSB_CALL h4032l_data_transfer_callback(struct libusb_transfer *transfer) struct dev_context *const devc = sdi->priv; uint32_t max_samples = transfer->actual_length / sizeof(uint32_t); uint32_t *buffer; - uint32_t number_samples; + uint32_t num_samples; /* * If acquisition has already ended, just free any queued up @@ -187,15 +187,15 @@ void LIBUSB_CALL h4032l_data_transfer_callback(struct libusb_transfer *transfer) buffer = (uint32_t *)transfer->buffer; - number_samples = MIN(devc->remaining_samples, max_samples); - devc->remaining_samples -= number_samples; - send_data(sdi, buffer, number_samples); + num_samples = MIN(devc->remaining_samples, max_samples); + devc->remaining_samples -= num_samples; + send_data(sdi, buffer, num_samples); sr_dbg("Remaining: %d %08X %08X.", devc->remaining_samples, buffer[0], buffer[1]); /* Close data receiving. */ if (devc->remaining_samples == 0) { - if (buffer[number_samples] != H4032L_END_PACKET_MAGIC) + if (buffer[num_samples] != H4032L_END_PACKET_MAGIC) sr_err("Mismatch magic number of end poll."); abort_acquisition(devc); @@ -218,7 +218,7 @@ void LIBUSB_CALL h4032l_usb_callback(struct libusb_transfer *transfer) uint32_t max_samples = transfer->actual_length / sizeof(uint32_t); uint32_t *buffer; struct h4032l_status_packet *status; - uint32_t number_samples; + uint32_t num_samples; int ret; /* @@ -288,9 +288,9 @@ void LIBUSB_CALL h4032l_usb_callback(struct libusb_transfer *transfer) buffer++; /* Fallthrough. */ case H4032L_STATUS_TRANSFER: - number_samples = MIN(devc->remaining_samples, max_samples); - devc->remaining_samples -= number_samples; - send_data(sdi, buffer, number_samples); + num_samples = MIN(devc->remaining_samples, max_samples); + devc->remaining_samples -= num_samples; + send_data(sdi, buffer, num_samples); sr_dbg("Remaining: %d %08X %08X.", devc->remaining_samples, buffer[0], buffer[1]); break;