]> sigrok.org Git - libsigrok.git/commitdiff
baylibre-acme: Optimize reading of values from sysfs.
authorDaniel Lezcano <redacted>
Wed, 27 May 2015 18:22:02 +0000 (20:22 +0200)
committerBartosz Golaszewski <redacted>
Mon, 29 Jun 2015 14:07:52 +0000 (16:07 +0200)
Opening a file has a cost (security, allocation, syscalls). The
read_sample() function always does an open/read/close sequence.

In order to optimize that, let's open the file at the moment the
acquisition starts, close it when the acquisition stops and make
read_sample() only lseek() to the beginning of the file and read
the value.

Signed-off-by: Daniel Lezcano <redacted>
Signed-off-by: Bartosz Golaszewski <redacted>

No differences found