Skip to content

Libgpiod Module Fixes - #147

Merged
Maxhy merged 5 commits into
leosac:developfrom
joshusooyaa:develop
Aug 5, 2025
Merged

Libgpiod Module Fixes#147
Maxhy merged 5 commits into
leosac:developfrom
joshusooyaa:develop

Conversation

@joshusooyaa

Copy link
Copy Markdown
Contributor

The libgpiod was not working due to linking errors, requesting the same gpio line multiple times (after being reserved) and using the incorrect interrupt type. This PR attempts to fix these by linking the libgpiod package, requesting only one GPIO line based off of the direction and interrupt mode, and updates the interrupt type to poll_in as opposed to poll_pri.

Code was calling libgpiod functions without them linked.
gpiod line requests reserve the line. The original code
was attempting to reserve a single line twice by setting both
direction and interrupt mode. When the direction is in, setting
to input is not required since the code will instead set a
rising edge, falling edge (or both) type notifications on a
single line.

See docs here: https://libgpiod-dlang.dpldocs.info/source/gpiod.d.html#L1054
poll_pri ignores GPIO interrupt events since they're
not priority. poll_in detects GPIO interrupt events
as normal input.

This resolves the issue with libgpiod module not picking
up rfid card swipes. Setting to poll_in fixes this.
@Maxhy

Maxhy commented Aug 5, 2025

Copy link
Copy Markdown
Member

Indeed this is much better. Thanks for the PR @joshusooyaa

@Maxhy
Maxhy merged commit f716ec9 into leosac:develop Aug 5, 2025
3 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants