From: Daniel Elstner Date: Mon, 31 Aug 2015 17:08:37 +0000 (+0200) Subject: drivers: Use timer sources instead of polling stdin X-Git-Tag: libsigrok-0.4.0~350 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c650d3ecbfeea1015df5ca38fa941bcb01254ed8;p=libsigrok.git drivers: Use timer sources instead of polling stdin --- diff --git a/src/hardware/asix-sigma/asix-sigma.c b/src/hardware/asix-sigma/asix-sigma.c index eaade4bf..c75fdffb 100644 --- a/src/hardware/asix-sigma/asix-sigma.c +++ b/src/hardware/asix-sigma/asix-sigma.c @@ -1517,7 +1517,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) std_session_send_df_header(sdi, LOG_PREFIX); /* Add capture source. */ - sr_session_source_add(sdi->session, 0, G_IO_IN, 10, receive_data, (void *)sdi); + sr_session_source_add(sdi->session, -1, 0, 10, receive_data, (void *)sdi); devc->state.state = SIGMA_CAPTURE; diff --git a/src/hardware/brymen-bm86x/api.c b/src/hardware/brymen-bm86x/api.c index 92baed54..5edc8383 100644 --- a/src/hardware/brymen-bm86x/api.c +++ b/src/hardware/brymen-bm86x/api.c @@ -264,7 +264,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, /* Send header packet to the session bus. */ std_session_send_df_header(sdi, LOG_PREFIX); - sr_session_source_add(sdi->session, 0, 0, 10, + sr_session_source_add(sdi->session, -1, 0, 10, brymen_bm86x_receive_data, (void *)sdi); return SR_OK; diff --git a/src/hardware/chronovu-la/api.c b/src/hardware/chronovu-la/api.c index c4cc2ab0..d735e1e1 100644 --- a/src/hardware/chronovu-la/api.c +++ b/src/hardware/chronovu-la/api.c @@ -504,7 +504,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) devc->trigger_found = 0; /* Hook up a dummy handler to receive data from the device. */ - sr_session_source_add(sdi->session, -1, G_IO_IN, 0, receive_data, (void *)sdi); + sr_session_source_add(sdi->session, -1, 0, 0, receive_data, (void *)sdi); return SR_OK; } diff --git a/src/hardware/ikalogic-scanaplus/api.c b/src/hardware/ikalogic-scanaplus/api.c index 456eb58c..b0660d79 100644 --- a/src/hardware/ikalogic-scanaplus/api.c +++ b/src/hardware/ikalogic-scanaplus/api.c @@ -382,7 +382,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) std_session_send_df_header(sdi, LOG_PREFIX); /* Hook up a dummy handler to receive data from the device. */ - sr_session_source_add(sdi->session, -1, G_IO_IN, 0, scanaplus_receive_data, (void *)sdi); + sr_session_source_add(sdi->session, -1, 0, 0, scanaplus_receive_data, (void *)sdi); return SR_OK; } diff --git a/src/hardware/pipistrello-ols/api.c b/src/hardware/pipistrello-ols/api.c index 3c7fc7b1..2c0313ba 100644 --- a/src/hardware/pipistrello-ols/api.c +++ b/src/hardware/pipistrello-ols/api.c @@ -693,7 +693,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, std_session_send_df_header(cb_data, LOG_PREFIX); /* Hook up a dummy handler to receive data from the device. */ - sr_session_source_add(sdi->session, 0, G_IO_IN, 10, p_ols_receive_data, + sr_session_source_add(sdi->session, -1, 0, 10, p_ols_receive_data, cb_data); return SR_OK; diff --git a/src/hardware/uni-t-dmm/api.c b/src/hardware/uni-t-dmm/api.c index a21663fc..199ad6b5 100644 --- a/src/hardware/uni-t-dmm/api.c +++ b/src/hardware/uni-t-dmm/api.c @@ -201,7 +201,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) /* Send header packet to the session bus. */ std_session_send_df_header(sdi, LOG_PREFIX); - sr_session_source_add(sdi->session, 0, 0, 10 /* poll_timeout */, + sr_session_source_add(sdi->session, -1, 0, 10 /* poll_timeout */, uni_t_dmm_receive_data, (void *)sdi); return SR_OK;