]> sigrok.org Git - libsigrok.git/commitdiff
hantek-4032l: Rename number_samples to num_samples.
authorUwe Hermann <redacted>
Tue, 5 Jun 2018 21:56:30 +0000 (23:56 +0200)
committerUwe Hermann <redacted>
Tue, 5 Jun 2018 21:56:30 +0000 (23:56 +0200)
src/hardware/hantek-4032l/api.c
src/hardware/hantek-4032l/protocol.c

index d0cbbd547f733ad9d0aee856ae7d380c64df7ea8..542e6c4a80cc7b70ab95b6eb0feb6f3342ba6d7e 100644 (file)
@@ -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)
index a3b4185888668bd6da4ad0a189a12d1e9343e3f8..1021d8fd8de150f65161345b4b6d60352864d0c5 100644 (file)
@@ -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;