]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Convert to SR_DF_ANALOG.
authorUwe Hermann <redacted>
Sat, 28 May 2016 15:41:35 +0000 (17:41 +0200)
committerUwe Hermann <redacted>
Thu, 16 Jun 2016 13:05:04 +0000 (15:05 +0200)
src/hardware/fx2lafw/protocol.c

index 8e69b77fd545eb38641d1fe34252cd6b182c16e0..29bb0df51f2a1d8467e225a490fbfdfd2debfa78 100644 (file)
@@ -390,6 +390,10 @@ SR_PRIV void mso_send_data_proc(struct sr_dev_inst *sdi,
 {
        size_t i;
        struct dev_context *devc;
+       struct sr_datafeed_analog analog;
+       struct sr_analog_encoding encoding;
+       struct sr_analog_meaning meaning;
+       struct sr_analog_spec spec;
 
        (void)sample_width;
 
@@ -417,17 +421,16 @@ SR_PRIV void mso_send_data_proc(struct sr_dev_inst *sdi,
 
        sr_session_send(sdi, &logic_packet);
 
-       const struct sr_datafeed_analog_old analog = {
-               .channels = devc->enabled_analog_channels,
-               .num_samples = length,
-               .mq = SR_MQ_VOLTAGE,
-               .unit = SR_UNIT_VOLT,
-               .mqflags = 0 /*SR_MQFLAG_DC*/,
-               .data = devc->analog_buffer
-       };
+       sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+       analog.meaning->channels = devc->enabled_analog_channels;
+       analog.meaning->mq = SR_MQ_VOLTAGE;
+       analog.meaning->unit = SR_UNIT_VOLT;
+       analog.meaning->mqflags = 0 /* SR_MQFLAG_DC */;
+       analog.num_samples = length;
+       analog.data = devc->analog_buffer;
 
        const struct sr_datafeed_packet analog_packet = {
-               .type = SR_DF_ANALOG_OLD,
+               .type = SR_DF_ANALOG,
                .payload = &analog
        };