]> sigrok.org Git - libsigrok.git/blobdiff - output/chronovu_la8.c
Replace 'probe' with 'channel' in most places.
[libsigrok.git] / output / chronovu_la8.c
index a6184da2f00fd14087845fdb3a9128cf1bf60865..b4c6903edbda9f2206ce5f5ad36d88e004315e3d 100644 (file)
 #include "libsigrok.h"
 #include "libsigrok-internal.h"
 
-/* Message logging helpers with driver-specific prefix string. */
-#define DRIVER_LOG_DOMAIN "output/chronovu-la8: "
-#define sr_log(l, s, args...) sr_log(l, DRIVER_LOG_DOMAIN s, ## args)
-#define sr_spew(s, args...) sr_spew(DRIVER_LOG_DOMAIN s, ## args)
-#define sr_dbg(s, args...) sr_dbg(DRIVER_LOG_DOMAIN s, ## args)
-#define sr_info(s, args...) sr_info(DRIVER_LOG_DOMAIN s, ## args)
-#define sr_warn(s, args...) sr_warn(DRIVER_LOG_DOMAIN s, ## args)
-#define sr_err(s, args...) sr_err(DRIVER_LOG_DOMAIN s, ## args)
+#define LOG_PREFIX "output/chronovu-la8"
 
 struct context {
-       unsigned int num_enabled_probes;
+       unsigned int num_enabled_channels;
        unsigned int unitsize;
        uint64_t trigger_point;
        uint64_t samplerate;
@@ -91,7 +84,7 @@ static uint8_t samplerate_to_divcount(uint64_t samplerate)
 static int init(struct sr_output *o)
 {
        struct context *ctx;
-       struct sr_probe *probe;
+       struct sr_channel *ch;
        GSList *l;
        GVariant *gvar;
 
@@ -113,16 +106,18 @@ static int init(struct sr_output *o)
        o->internal = ctx;
 
        /* Get the unitsize. */
-       for (l = o->sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (!probe->enabled)
+       for (l = o->sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_PROBE_LOGIC)
                        continue;
-               ctx->num_enabled_probes++;
+               if (!ch->enabled)
+                       continue;
+               ctx->num_enabled_channels++;
        }
-       ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
+       ctx->unitsize = (ctx->num_enabled_channels + 7) / 8;
 
-       if (sr_config_get(o->sdi->driver, SR_CONF_SAMPLERATE, &gvar,
-                       o->sdi) == SR_OK) {
+       if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
+                       &gvar) == SR_OK) {
                ctx->samplerate = g_variant_get_uint64(gvar);
                g_variant_unref(gvar);
        } else