From: Gerhard Sittig Date: Sun, 9 Jan 2022 21:30:50 +0000 (+0100) Subject: kingst-la2016: rename routine before moving from api.c to protocol.c X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=388438e497cf4faa339bd045c69b33c1429e912e;p=libsigrok.git kingst-la2016: rename routine before moving from api.c to protocol.c The Kingst LA2016 driver implementation would not follow the typical separation of api.c and protocol.c responsibilities, instead encodes USB communication to the device on the api.c side. Rename a driver routine before moving it between files, provide an SR_PRIV decoration. --- diff --git a/src/hardware/kingst-la2016/api.c b/src/hardware/kingst-la2016/api.c index 216869ed..f6bf6438 100644 --- a/src/hardware/kingst-la2016/api.c +++ b/src/hardware/kingst-la2016/api.c @@ -662,7 +662,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) devc->transfer_finished = 1; } -static int handle_event(int fd, int revents, void *cb_data) +SR_PRIV int la2016_receive_data(int fd, int revents, void *cb_data) { const struct sr_dev_inst *sdi; struct dev_context *devc; @@ -780,7 +780,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) } devc->have_trigger = 0; - usb_source_add(sdi->session, drvc->sr_ctx, 50, handle_event, (void *)sdi); + usb_source_add(sdi->session, drvc->sr_ctx, 50, + la2016_receive_data, (void *)sdi); std_session_send_df_header(sdi); diff --git a/src/hardware/kingst-la2016/protocol.h b/src/hardware/kingst-la2016/protocol.h index 09e12be6..e6ffff01 100644 --- a/src/hardware/kingst-la2016/protocol.h +++ b/src/hardware/kingst-la2016/protocol.h @@ -126,6 +126,7 @@ SR_PRIV int la2016_stop_acquisition(const struct sr_dev_inst *sdi); SR_PRIV int la2016_abort_acquisition(const struct sr_dev_inst *sdi); SR_PRIV int la2016_has_triggered(const struct sr_dev_inst *sdi); SR_PRIV int la2016_start_retrieval(const struct sr_dev_inst *sdi, libusb_transfer_cb_fn cb); +SR_PRIV int la2016_receive_data(int fd, int revents, void *cb_data); SR_PRIV int la2016_init_device(const struct sr_dev_inst *sdi); SR_PRIV int la2016_deinit_device(const struct sr_dev_inst *sdi);