]> sigrok.org Git - libsigrok.git/commit
baylibre-acme: Use timerfd instead of a fake pipe.
authorDaniel Lezcano <redacted>
Thu, 4 Jun 2015 17:01:27 +0000 (19:01 +0200)
committerUwe Hermann <redacted>
Tue, 30 Jun 2015 22:00:33 +0000 (00:00 +0200)
commita0648b1a12699429d8a70b8eeb05942885bd32b3
treedd4e9a46276f6e0bd6b64b0371800b71688062f0
parentf9b0ab6b2db8b997a79e0dde37b7240779c76cea
baylibre-acme: Use timerfd instead of a fake pipe.

Currently baylibre-acme uses a fake pipe as the input channel required by
libsigrok API and calls sleep() in the data acquisition callback to create
intervals between measurements.

Switch to a more elegant approach: use Linux' timerfd and set a periodic
timer equal to the sampling rate. Then read the data every time the timer
expires.

Signed-off-by: Daniel Lezcano <redacted>
Signed-off-by: Bartosz Golaszewski <redacted>
src/hardware/baylibre-acme/api.c
src/hardware/baylibre-acme/protocol.c
src/hardware/baylibre-acme/protocol.h