X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fsysclk-lwla%2Fprotocol.c;h=b4c3171e240ceb73dc3cbc3337085045a4efa534;hb=1c47e0da8f2571bc34dbdc368c3c1f55318c3aa0;hp=a8d71b799c9cae57b9458a917425c1f637530cfd;hpb=407b6e2cff817c6b05f1f038e2fecd94ad11fa86;p=libsigrok.git diff --git a/src/hardware/sysclk-lwla/protocol.c b/src/hardware/sysclk-lwla/protocol.c index a8d71b79..b4c3171e 100644 --- a/src/hardware/sysclk-lwla/protocol.c +++ b/src/hardware/sysclk-lwla/protocol.c @@ -212,6 +212,7 @@ static void handle_read_response(const struct sr_dev_inst *sdi) end_addr = MIN(acq->mem_addr_next, acq->mem_addr_stop); acq->in_index = 0; + /* * Repeatedly call the model-specific read response handler until * all data received in the transfer has been accounted for. @@ -276,7 +277,6 @@ static int transfer_event(int fd, int revents, void *cb_data) struct dev_context *devc; struct drv_context *drvc; struct timeval tv; - struct sr_datafeed_packet packet; int ret; (void)fd; @@ -316,10 +316,7 @@ static int transfer_event(int fd, int revents, void *cb_data) /* We are done, clean up and send end packet to session bus. */ clear_acquisition_state(sdi); - - packet.type = SR_DF_END; - packet.payload = NULL; - sr_session_send(sdi, &packet); + std_session_send_df_end(sdi, LOG_PREFIX); return G_SOURCE_REMOVE; } @@ -545,7 +542,6 @@ SR_PRIV int lwla_start_acquisition(const struct sr_dev_inst *sdi) struct drv_context *drvc; struct dev_context *devc; int ret; - const int poll_interval_ms = 100; drvc = sdi->driver->context; @@ -577,13 +573,13 @@ SR_PRIV int lwla_start_acquisition(const struct sr_dev_inst *sdi) } ret = submit_request(sdi, STATE_START_CAPTURE); - if (ret == SR_OK) { - /* Send header packet to the session bus. */ + if (ret == SR_OK) ret = std_session_send_df_header(sdi, LOG_PREFIX); - } + if (ret != SR_OK) { usb_source_remove(sdi->session, drvc->sr_ctx); clear_acquisition_state(sdi); } + return ret; }