X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fzeroplus-logic-cube%2Fzeroplus.c;h=4d3df029bbc55e34fef737fca07d0ff48d43a39c;hb=4afdfd4628e9955af02a3ea619ecdfe469f9a9e2;hp=c4add3fc5afc0c9c3beec31f3f3ca2d4dfce89fd;hpb=6d1161142dfce461c8e54c09d821443c68916df8;p=libsigrok.git diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index c4add3fc..4d3df029 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -382,11 +382,7 @@ static GSList *hw_scan(GSList *options) static GSList *hw_dev_list(void) { - struct drv_context *drvc; - - drvc = di->priv; - - return drvc->instances; + return ((struct drv_context *)(di->priv))->instances; } static int hw_dev_open(struct sr_dev_inst *sdi) @@ -487,10 +483,7 @@ static int hw_dev_close(struct sr_dev_inst *sdi) { struct dev_context *devc; - if (!(devc = sdi->priv)) { - sr_err("%s: sdi->priv was NULL", __func__); - return SR_ERR; - } + devc = sdi->priv; if (!devc->usb->devhdl) return SR_ERR; @@ -683,7 +676,6 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, { struct sr_datafeed_packet packet; struct sr_datafeed_logic logic; - struct sr_datafeed_header header; //uint64_t samples_read; int res; unsigned int packet_num; @@ -717,11 +709,8 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, sr_info("Trigger address = 0x%x.", analyzer_get_trigger_address(devc->usb->devhdl)); - packet.type = SR_DF_HEADER; - packet.payload = &header; - header.feed_version = 1; - gettimeofday(&header.starttime, NULL); - sr_session_send(cb_data, &packet); + /* Send header packet to the session bus. */ + std_session_send_df_header(cb_data, DRIVER_LOG_DOMAIN); if (!(buf = g_try_malloc(PACKET_SIZE))) { sr_err("Packet buffer malloc failed.");