From: Daniel Elstner Date: Tue, 22 Sep 2015 04:54:33 +0000 (+0200) Subject: demo: Increase timer interval to 100 ms X-Git-Tag: libsigrok-0.4.0~253 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=98c01fe1277e5a386377347635a8a7fee8abc534;p=libsigrok.git demo: Increase timer interval to 100 ms Timer intervals shorter than about 100 ms are unnecessarily taxing on system resources. Also, on systems like Windows the smallest resolvable time unit without using high precision timers is about 15 ms. Regular timer intervals should be well above that value to avoid being dominated by noise and round-off. --- diff --git a/src/hardware/demo/demo.c b/src/hardware/demo/demo.c index ce824918..6a1a2b2a 100644 --- a/src/hardware/demo/demo.c +++ b/src/hardware/demo/demo.c @@ -865,7 +865,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) while (g_hash_table_iter_next(&iter, NULL, &value)) generate_analog_pattern(value, devc->cur_samplerate); - sr_session_source_add(sdi->session, -1, 0, 40, prepare_data, (void *)sdi); + sr_session_source_add(sdi->session, -1, 0, 100, + prepare_data, (struct sr_dev_inst *)sdi); /* Send header packet to the session bus. */ std_session_send_df_header(sdi, LOG_PREFIX);