X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fbaylibre-acme%2Fprotocol.c;h=8d23b9e2f9875d36093115c52b1911c3e1ac1e2a;hb=dca972f8ba1eca12fd462bd97788b18c8953ce64;hp=17ae5b90859e764eb852439dadeab9314823cd64;hpb=8ebad343709aad6ef4d5aa83a2633690ef313de5;p=libsigrok.git diff --git a/src/hardware/baylibre-acme/protocol.c b/src/hardware/baylibre-acme/protocol.c index 17ae5b90..8d23b9e2 100644 --- a/src/hardware/baylibre-acme/protocol.c +++ b/src/hardware/baylibre-acme/protocol.c @@ -332,9 +332,8 @@ SR_PRIV gboolean bl_acme_register_probe(struct sr_dev_inst *sdi, int type, if (hwmon < 0) return FALSE; - cg = g_malloc0(sizeof(struct sr_channel_group)); cgp = g_malloc0(sizeof(struct channel_group_priv)); - cg->priv = cgp; + cg = sr_channel_group_new(sdi, NULL, cgp); /* * See if we can read the EEPROM contents. If not, assume it's @@ -380,8 +379,6 @@ SR_PRIV gboolean bl_acme_register_probe(struct sr_dev_inst *sdi, int type, sr_err("Invalid probe type: %d.", type); } - sdi->channel_groups = g_slist_append(sdi->channel_groups, cg); - return TRUE; } @@ -703,7 +700,7 @@ SR_PRIV void bl_acme_close_channel(struct sr_channel *ch) SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) { uint64_t nrexpiration; - struct sr_datafeed_packet packet, framep; + struct sr_datafeed_packet packet; struct sr_datafeed_analog analog; struct sr_analog_encoding encoding; struct sr_analog_meaning meaning; @@ -759,8 +756,7 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) * accuracy. */ for (i = 0; i < nrexpiration; i++) { - framep.type = SR_DF_FRAME_BEGIN; - sr_session_send(sdi, &framep); + std_session_send_df_frame_begin(sdi); /* * Due to different units used in each channel we're sending @@ -788,8 +784,7 @@ SR_PRIV int bl_acme_receive_data(int fd, int revents, void *cb_data) sr_session_send(sdi, &packet); } - framep.type = SR_DF_FRAME_END; - sr_session_send(sdi, &framep); + std_session_send_df_frame_end(sdi); } sr_sw_limits_update_samples_read(&devc->limits, 1);