]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/maynuo-m97/protocol.c
openbench-logic-sniffer: Avoid recreating event source
[libsigrok.git] / src / hardware / maynuo-m97 / protocol.c
index 5ef16ac730284da67562252df6ff85fa0930cc24..a85989f260e8d3457115e747b8976b4d18f5a3d0 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include "protocol.h"
 
 SR_PRIV int maynuo_m97_get_bit(struct sr_modbus_dev_inst *modbus,
@@ -127,7 +128,7 @@ SR_PRIV const char *maynuo_m97_mode_to_str(enum maynuo_m97_mode mode)
 static void maynuo_m97_session_send_value(const struct sr_dev_inst *sdi, struct sr_channel *ch, float value, enum sr_mq mq, enum sr_unit unit)
 {
        struct sr_datafeed_packet packet;
-       struct sr_datafeed_analog analog;
+       struct sr_datafeed_analog_old analog;
 
        analog.channels = g_slist_append(NULL, ch);
        analog.num_samples = 1;
@@ -136,7 +137,7 @@ static void maynuo_m97_session_send_value(const struct sr_dev_inst *sdi, struct
        analog.unit = unit;
        analog.mqflags = SR_MQFLAG_DC;
 
-       packet.type = SR_DF_ANALOG;
+       packet.type = SR_DF_ANALOG_OLD;
        packet.payload = &analog;
        sr_session_send(sdi, &packet);
        g_slist_free(analog.channels);