From: Frank Stettner Date: Thu, 7 Sep 2017 14:09:10 +0000 (+0200) Subject: conrad-digi-35-cpu: Add and use missing dev_context structure X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=eea576077b0ce83ca93508698dc588c3145310ce;p=libsigrok.git conrad-digi-35-cpu: Add and use missing dev_context structure --- diff --git a/src/hardware/conrad-digi-35-cpu/api.c b/src/hardware/conrad-digi-35-cpu/api.c index 1f0d220a..03185cca 100644 --- a/src/hardware/conrad-digi-35-cpu/api.c +++ b/src/hardware/conrad-digi-35-cpu/api.c @@ -39,6 +39,7 @@ static const uint32_t devopts[] = { static GSList *scan(struct sr_dev_driver *di, GSList *options) { + struct dev_context *devc; struct sr_dev_inst *sdi; struct sr_config *src; struct sr_serial_dev_inst *serial; @@ -83,8 +84,11 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) sdi->status = SR_ST_INACTIVE; sdi->vendor = g_strdup("Conrad"); sdi->model = g_strdup("DIGI 35 CPU"); + devc = g_malloc0(sizeof(struct dev_context)); + sr_sw_limits_init(&devc->limits); + sdi->inst_type = SR_INST_SERIAL; sdi->conn = serial; - sdi->priv = NULL; + sdi->priv = devc; sr_channel_new(sdi, 0, SR_CHANNEL_ANALOG, TRUE, "CH1"); return std_scan_complete(di, g_slist_append(NULL, sdi)); diff --git a/src/hardware/conrad-digi-35-cpu/protocol.h b/src/hardware/conrad-digi-35-cpu/protocol.h index b02af9e2..09a1428f 100644 --- a/src/hardware/conrad-digi-35-cpu/protocol.h +++ b/src/hardware/conrad-digi-35-cpu/protocol.h @@ -28,6 +28,10 @@ #define LOG_PREFIX "conrad-digi-35-cpu" +struct dev_context { + struct sr_sw_limits limits; +}; + SR_PRIV int send_msg1(const struct sr_dev_inst *sdi, char cmd, int param); #endif