]> sigrok.org Git - libsigrok.git/commitdiff
Replace some 'pg' with 'cg'.
authorUwe Hermann <redacted>
Fri, 14 Mar 2014 20:22:29 +0000 (21:22 +0100)
committerUwe Hermann <redacted>
Tue, 25 Mar 2014 19:58:54 +0000 (20:58 +0100)
(since 'probe groups' are now called 'channel groups')

This fixes parts of bug #259.

hardware/atten-pps3xxx/api.c
hardware/demo/demo.c

index ec344f3b6b205229459ede365e7b2b68713e7c2e..1ed7871894d36f7d8be94bb347aecb94d19a58d9 100644 (file)
@@ -43,7 +43,7 @@ static const int32_t devopts[] = {
        SR_CONF_OVER_CURRENT_PROTECTION,
 };
 
-static const int32_t devopts_pg[] = {
+static const int32_t devopts_cg[] = {
        SR_CONF_OUTPUT_VOLTAGE,
        SR_CONF_OUTPUT_VOLTAGE_MAX,
        SR_CONF_OUTPUT_CURRENT,
@@ -88,7 +88,7 @@ static GSList *scan(GSList *options, int modelid)
        struct dev_context *devc;
        struct sr_config *src;
        struct sr_probe *probe;
-       struct sr_channel_group *pg;
+       struct sr_channel_group *cg;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        struct pps_model *model;
@@ -169,11 +169,11 @@ static GSList *scan(GSList *options, int modelid)
                snprintf(channel, 10, "CH%d", i + 1);
                probe = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel);
                sdi->probes = g_slist_append(sdi->probes, probe);
-               pg = g_malloc(sizeof(struct sr_channel_group));
-               pg->name = g_strdup(channel);
-               pg->probes = g_slist_append(NULL, probe);
-               pg->priv = NULL;
-               sdi->channel_groups = g_slist_append(sdi->channel_groups, pg);
+               cg = g_malloc(sizeof(struct sr_channel_group));
+               cg->name = g_strdup(channel);
+               cg->probes = g_slist_append(NULL, probe);
+               cg->priv = NULL;
+               sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
        }
 
        devc = g_malloc0(sizeof(struct dev_context));
@@ -409,7 +409,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
                        *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                       devopts_pg, ARRAY_SIZE(devopts_pg), sizeof(int32_t));
+                                       devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
                        break;
                case SR_CONF_OUTPUT_VOLTAGE_MAX:
                        g_variant_builder_init(&gvb, G_VARIANT_TYPE_ARRAY);
index 39c423021dc905708569a5d5f1952bcd8b079ece..754e72f74216485d3891d6aa2ebb35979b53ace2 100644 (file)
@@ -139,7 +139,7 @@ static const int devopts[] = {
        SR_CONF_LIMIT_MSEC,
 };
 
-static const int devopts_pg[] = {
+static const int devopts_cg[] = {
        SR_CONF_PATTERN_MODE,
 };
 
@@ -257,7 +257,7 @@ static GSList *scan(GSList *options)
        struct dev_context *devc;
        struct sr_dev_inst *sdi;
        struct sr_probe *probe;
-       struct sr_channel_group *pg;
+       struct sr_channel_group *cg;
        struct sr_config *src;
        struct analog_gen *ag;
        GSList *devices, *l;
@@ -303,19 +303,19 @@ static GSList *scan(GSList *options)
        devc->analog_channel_groups = NULL;
 
        /* Logic probes, all in one channel group. */
-       if (!(pg = g_try_malloc(sizeof(struct sr_channel_group))))
+       if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
                return NULL;
-       pg->name = g_strdup("Logic");
-       pg->probes = NULL;
-       pg->priv = NULL;
+       cg->name = g_strdup("Logic");
+       cg->probes = NULL;
+       cg->priv = NULL;
        for (i = 0; i < num_logic_probes; i++) {
                sprintf(probe_name, "D%d", i);
                if (!(probe = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, probe_name)))
                        return NULL;
                sdi->probes = g_slist_append(sdi->probes, probe);
-               pg->probes = g_slist_append(pg->probes, probe);
+               cg->probes = g_slist_append(cg->probes, probe);
        }
-       sdi->channel_groups = g_slist_append(NULL, pg);
+       sdi->channel_groups = g_slist_append(NULL, cg);
 
        /* Analog probes, channel groups and pattern generators. */
 
@@ -328,24 +328,24 @@ static GSList *scan(GSList *options)
                sdi->probes = g_slist_append(sdi->probes, probe);
 
                /* Every analog probe gets its own channel group. */
-               if (!(pg = g_try_malloc(sizeof(struct sr_channel_group))))
+               if (!(cg = g_try_malloc(sizeof(struct sr_channel_group))))
                        return NULL;
-               pg->name = g_strdup(probe_name);
-               pg->probes = g_slist_append(NULL, probe);
+               cg->name = g_strdup(probe_name);
+               cg->probes = g_slist_append(NULL, probe);
 
                /* Every channel group gets a generator struct. */
                if (!(ag = g_try_malloc(sizeof(struct analog_gen))))
                        return NULL;
-               ag->packet.probes = pg->probes;
+               ag->packet.probes = cg->probes;
                ag->packet.mq = 0;
                ag->packet.mqflags = 0;
                ag->packet.unit = SR_UNIT_VOLT;
                ag->packet.data = ag->pattern_data;
                ag->pattern = pattern;
-               pg->priv = ag;
+               cg->priv = ag;
 
-               sdi->channel_groups = g_slist_append(sdi->channel_groups, pg);
-               devc->analog_channel_groups = g_slist_append(devc->analog_channel_groups, pg);
+               sdi->channel_groups = g_slist_append(sdi->channel_groups, cg);
+               devc->analog_channel_groups = g_slist_append(devc->analog_channel_groups, cg);
 
                if (++pattern == ARRAY_SIZE(analog_pattern_str))
                        pattern = 0;
@@ -549,7 +549,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                switch (key) {
                case SR_CONF_DEVICE_OPTIONS:
                        *data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
-                                       devopts_pg, ARRAY_SIZE(devopts_pg), sizeof(int32_t));
+                                       devopts_cg, ARRAY_SIZE(devopts_cg), sizeof(int32_t));
                        break;
                case SR_CONF_PATTERN_MODE:
                        if (probe->type == SR_PROBE_LOGIC)
@@ -617,7 +617,7 @@ static int prepare_data(int fd, int revents, void *cb_data)
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_logic logic;
-       struct sr_channel_group *pg;
+       struct sr_channel_group *cg;
        struct analog_gen *ag;
        GSList *l;
        uint64_t logic_todo, analog_todo, expected_samplenum, analog_samples, sending_now;
@@ -658,8 +658,8 @@ static int prepare_data(int fd, int revents, void *cb_data)
                if (devc->num_analog_probes > 0 && analog_todo > 0) {
                        sending_now = 0;
                        for (l = devc->analog_channel_groups; l; l = l->next) {
-                               pg = l->data;
-                               ag = pg->priv;
+                               cg = l->data;
+                               ag = cg->priv;
                                packet.type = SR_DF_ANALOG;
                                packet.payload = &ag->packet;