]> sigrok.org Git - libsigrok.git/commitdiff
zeroplus: Rename max_memory_size to max_sample_depth
authorRuss Dill <redacted>
Tue, 3 Dec 2013 05:51:53 +0000 (21:51 -0800)
committerBert Vermeulen <redacted>
Thu, 5 Dec 2013 00:09:51 +0000 (01:09 +0100)
This private variable is measured in samples, not bytes. Avoid confusion
by renaming it.

hardware/zeroplus-logic-cube/api.c
hardware/zeroplus-logic-cube/protocol.c
hardware/zeroplus-logic-cube/protocol.h

index d85a8ca07ae8cba0987135083e87c5dd524080f2..2ff8cc932ef70f73dd8c21a494569ff5db6b3cfa 100644 (file)
@@ -307,10 +307,10 @@ static GSList *scan(GSList *options)
                devc->prof = prof;
                devc->num_channels = prof->channels;
 #ifdef ZP_EXPERIMENTAL
-               devc->max_memory_size = 128 * 1024;
+               devc->max_sample_depth = 128 * 1024;
                devc->max_samplerate = 200;
 #else
-               devc->max_memory_size = prof->sample_depth * 1024;
+               devc->max_sample_depth = prof->sample_depth * 1024;
                devc->max_samplerate = prof->max_sampling_freq;
 #endif
                devc->max_samplerate *= SR_MHZ(1);
@@ -617,8 +617,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi,
        analyzer_read_start(usb->devhdl);
        /* Send the incoming transfer to the session bus. */
        n = get_memory_size(devc->memory_size);
-       if (devc->max_memory_size * 4 < n)
-               n = devc->max_memory_size * 4;
+       if (devc->max_sample_depth * 4 < n)
+               n = devc->max_sample_depth * 4;
        for (packet_num = 0; packet_num < n / PACKET_SIZE; packet_num++) {
                res = analyzer_read_data(usb->devhdl, buf, PACKET_SIZE);
                sr_info("Tried to read %d bytes, actually read %d bytes.",
index bbccc6fd238cea5ee93c673973b8656902a929c0..761dd708344816700d810b0479b0a4f3f9d28273 100644 (file)
@@ -75,8 +75,8 @@ SR_PRIV void set_triggerbar(struct dev_context *devc)
        ramsize = get_memory_size(devc->memory_size) / 4;
        if (devc->trigger) {
                n = ramsize;
-               if (devc->max_memory_size < n)
-                       n = devc->max_memory_size;
+               if (devc->max_sample_depth < n)
+                       n = devc->max_sample_depth;
                if (devc->limit_samples < n)
                        n = devc->limit_samples;
                n = n * devc->capture_ratio / 100;
index d3f1ea1705647b502bca1e977c28cf23394873c0..64fca8090ca6f2f4bef7d1d797e38171d2c525a6 100644 (file)
@@ -44,7 +44,7 @@ struct dev_context {
        uint64_t limit_samples;
        int num_channels;
        int memory_size;
-       unsigned int max_memory_size;
+       unsigned int max_sample_depth;
        //uint8_t probe_mask;
        //uint8_t trigger_mask[NUM_TRIGGER_STAGES];
        //uint8_t trigger_value[NUM_TRIGGER_STAGES];