]> sigrok.org Git - libsigrok.git/commitdiff
More consistent spelling of "samplerate".
authorUwe Hermann <redacted>
Mon, 5 Apr 2010 13:31:39 +0000 (15:31 +0200)
committerUwe Hermann <redacted>
Mon, 5 Apr 2010 16:30:02 +0000 (18:30 +0200)
hardware/openbench-logic-sniffer/ols.c
hardware/saleae-logic/saleae-logic.c
hardware/zeroplus-logic-cube/zeroplus.c
output/output_text.c
output/output_vcd.c
sigrok.h

index 5f6a35dedff4099d569585ca824afb25d7bd6ef5..3c844e613f4cbc660b91d57da68e905da65be9a8 100644 (file)
@@ -344,7 +344,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        case DI_TRIGGER_TYPES:
                info = (char *) TRIGGER_TYPES;
                break;
-       case DI_CUR_SAMPLE_RATE:
+       case DI_CUR_SAMPLERATE:
                info = &cur_samplerate;
                break;
        }
@@ -596,7 +596,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        packet->payload = (unsigned char *) header;
        header->feed_version = 1;
        gettimeofday(&header->starttime, NULL);
-       header->rate = cur_samplerate;
+       header->samplerate = cur_samplerate;
        header->protocol_id = PROTO_RAW;
        header->num_probes = NUM_PROBES;
        session_bus(session_device_id, packet);
index 2b804beabe392a64114519220abedeaf69de79eb..210a35ca5f98369ec20588db544cfc079cd67015 100644 (file)
@@ -92,7 +92,7 @@ static struct samplerates samplerates = {
 };
 
 /* TODO: all of these should go in a device-specific struct */
-static uint64_t cur_sample_rate = 0;
+static uint64_t cur_samplerate = 0;
 static uint64_t limit_samples = 0;
 static uint8_t probe_mask = 0, \
                trigger_mask[NUM_TRIGGER_STAGES] = {0}, \
@@ -459,7 +459,7 @@ static int hw_opendev(int device_index)
                return SIGROK_NOK;
        }
 
-       if(cur_sample_rate == 0) {
+       if(cur_samplerate == 0) {
                /* sample rate hasn't been set; default to the slowest it has */
                if(hw_set_configuration(device_index, HWCAP_SAMPLERATE, &supported_samplerates[0]) == SIGROK_NOK)
                        return SIGROK_NOK;
@@ -523,8 +523,8 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        case DI_TRIGGER_TYPES:
                info = TRIGGER_TYPES;
                break;
-       case DI_CUR_SAMPLE_RATE:
-               info = &cur_sample_rate;
+       case DI_CUR_SAMPLERATE:
+               info = &cur_samplerate;
                break;
        }
 
@@ -566,7 +566,7 @@ static int set_configuration_samplerate(struct sigrok_device_instance *sdi, uint
 
        divider = (uint8_t) (48 / (float) (samplerate/1000000)) - 1;
 
-       g_message("setting sample rate to %"PRIu64" Hz (divider %d)", samplerate, divider);
+       g_message("setting samplerate to %"PRIu64" Hz (divider %d)", samplerate, divider);
        buf[0] = 0x01;
        buf[1] = divider;
        ret = libusb_bulk_transfer(sdi->usb->devhdl, 1 | LIBUSB_ENDPOINT_OUT, buf, 2, &result, 500);
@@ -574,7 +574,7 @@ static int set_configuration_samplerate(struct sigrok_device_instance *sdi, uint
                g_warning("failed to set samplerate: %d", ret);
                return SIGROK_NOK;
        }
-       cur_sample_rate = samplerate;
+       cur_samplerate = samplerate;
 
        return SIGROK_OK;
 }
@@ -790,7 +790,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        packet->payload = (unsigned char *) header;
        header->feed_version = 1;
        gettimeofday(&header->starttime, NULL);
-       header->rate = cur_sample_rate;
+       header->samplerate = cur_samplerate;
        header->protocol_id = PROTO_RAW;
        header->num_probes = NUM_PROBES;
        session_bus(session_device_id, packet);
index 415a5a5c605ccc5ef8f51ccd4a1d8161853ba807..51f3cb9c4bf2d91eae73f03955c9fd709cfbd22c 100644 (file)
@@ -74,7 +74,7 @@ static GSList *device_instances = NULL;
 
 static libusb_context *usb_context = NULL;
 
-/* The hardware supports more sample rates than these, but these are the options
+/* The hardware supports more samplerates than these, but these are the options
    hardcoded into the vendor's Windows GUI */
 
 // XXX we shouldn't support 150MHz and 200MHz on devices that don't go up that high
@@ -393,7 +393,7 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        case DI_TRIGGER_TYPES:
                info = TRIGGER_TYPES;
                break;
-       case DI_CUR_SAMPLE_RATE:
+       case DI_CUR_SAMPLERATE:
                info = &cur_samplerate;
                break;
        }
@@ -486,7 +486,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
        packet.payload = (unsigned char *) &header;
        header.feed_version = 1;
        gettimeofday(&header.starttime, NULL);
-       header.rate = cur_samplerate;
+       header.samplerate = cur_samplerate;
        header.protocol_id = PROTO_RAW;
        header.num_probes = num_channels;
        session_bus(session_device_id, &packet);
index 9ef300336046b0ba9b4f30db31d1456081a2dfe8..0507e02c51262948b09c066e7c4c2d1b96b3a0a4 100644 (file)
@@ -93,7 +93,7 @@ static void init(struct output *o, int default_spl)
 
        ctx->header = malloc(512);
        num_probes = g_slist_length(o->device->probes);
-       samplerate = *((uint64_t *) o->device->plugin->get_device_info(o->device->plugin_index, DI_CUR_SAMPLE_RATE));
+       samplerate = *((uint64_t *) o->device->plugin->get_device_info(o->device->plugin_index, DI_CUR_SAMPLERATE));
        snprintf(ctx->header, 512, "Acquisition with %d/%d probes at ", ctx->num_enabled_probes, num_probes);
        if(samplerate >= GHZ(1))
                snprintf(ctx->header + strlen(ctx->header), 512, "%"PRIu64" GHz", samplerate / 1000000000);
index d5d9630505d7612428d56aa14974e4bda2133402..c9eba1bb0cd5d18f7bb99f499bc65eb13b1950df 100644 (file)
@@ -74,7 +74,7 @@ static void init(struct output *o)
        ctx->header = calloc(1, MAX_HEADER_LEN + 1);
        num_probes = g_slist_length(o->device->probes);
        samplerate = *((uint64_t *) o->device->plugin->get_device_info(
-                       o->device->plugin_index, DI_CUR_SAMPLE_RATE));
+                       o->device->plugin_index, DI_CUR_SAMPLERATE));
 
        /* Samplerate string */
        if (samplerate >= GHZ(1))
index 3729a43c36ae042c6bd94f6db00ce6dee6100a27..cf5cb61f2dd1e18be897551611233f9550744c07 100644 (file)
--- a/sigrok.h
+++ b/sigrok.h
@@ -81,7 +81,7 @@ struct datafeed_packet {
 struct datafeed_header {
        int feed_version;
        struct timeval starttime;
-       uint64_t rate;
+       uint64_t samplerate;
        int protocol_id;
        int num_probes;
 };
@@ -197,7 +197,7 @@ void device_trigger_set(struct device *device, int probenum, char *trigger);
 enum {
        HWCAP_DUMMY,            // used to terminate lists
        HWCAP_LOGIC_ANALYZER,
-       HWCAP_SAMPLERATE,       // change sample rate
+       HWCAP_SAMPLERATE,       // change samplerate
        HWCAP_PROBECONFIG,      // configure probe mask
        HWCAP_CAPTURE_RATIO,    // set pre-trigger / post-trigger ratio
        HWCAP_LIMIT_MSEC,       // set a time limit for sample acquisition
@@ -263,12 +263,12 @@ enum {
        DI_INSTANCE,
        /* The number of probes connected to this device */
        DI_NUM_PROBES,
-       /* Sample rates supported by this device, (struct samplerates) */
+       /* Samplerates supported by this device, (struct samplerates) */
        DI_SAMPLERATES,
        /* Types of trigger supported, out of "01crf" (char *) */
        DI_TRIGGER_TYPES,
-       /* The currently set sample rate in Hz (uint64_t) */
-       DI_CUR_SAMPLE_RATE,
+       /* The currently set samplerate in Hz (uint64_t) */
+       DI_CUR_SAMPLERATE,
 };
 
 /* a device supports either a range of samplerates with steps of a given