1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-24 00:48:53 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Rostyslav Lobov
9f0eca2d72 examples: reconfigure_input_to_output: Remove useless variable
The `req_cfg` is declared to NULL, never used and then freed.

Signed-off-by: Rostyslav Lobov <rostyslav@exmakhina.com>
Link: https://lore.kernel.org/r/20250329031923.564215-1-rostyslav@exmakhina.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-03-31 09:29:54 +02:00
Kent Gibson
dae1bc711f examples: simplify find_line_by_name
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>
2023-07-28 16:59:06 +02:00
Bartosz Golaszewski
37b3ac4bb5 build: remove redundant SOURCES assignments
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>
2023-06-30 14:51:34 +02:00
Kent Gibson
e15c06c306 core: examples: fix warning for u64 formatting on 32bit
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>
2023-06-30 14:16:05 +02:00
Kent Gibson
a520383ee9 core: examples: fix file comments
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>
2023-06-26 10:06:11 +02:00
Kent Gibson
4254100d89 core: examples: add more use case examples
Add examples for use cases drawn from the tools.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2023-06-23 16:41:33 +02:00
Kent Gibson
b77080c1d6 core: examples: consistency cleanups
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>
2023-06-23 15:55:44 +02:00
Kent Gibson
220281b46f examples: add dedicated examples
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>
2023-06-14 14:54:25 +02:00