Simplify the find_line_by_name example by using
gpiod_chip_get_line_offset_from_name() rather than iterating over each
line in a chip.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
For any given target (let's say foobar), automake defaults to looking for
foobar.c if foobar_SOURCES are not specified. Remove redundant assignments
as we've seen multiple hidden typos in makefiles already.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Kent Gibson <warthog618@gmail.com>
The watch_line_info example prints the u64 timestamps using "%ld" which
produces a warning for 32bit. Replace it with PRIu64.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Some of the file comments are cut-and-paste errors, so replace them
with the correct comment.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
A collection of minor cleanups to make the examples more consistent and
ease the addition of more examples:
- reformat Makefile.am to simplify adding more examples
- add line offset to value output
- remove commas from edge event output
- replace while(1) with for (;;)
- fix a typo in Makefile.am
- fix an error handling goto in toggle_line_value.c
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
The tools have served as example code, but have become too complicated
to serve that purpose.
Add a set of examples that have no purpose other than providing minimal
examples of common use cases.
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>