Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Based on the context provided, the issue you’re encountering is due to the gpiod_ctxless_event_monitor
function holding the GPIO chip open, which prevents simultaneous access to read other GPIO inputs using gpiod_ctxless_get_value
. Here are some alternative approaches you can consider:
-
Separate Context: Use a separate context or handle for reading GPIO values. This might involve temporarily closing the event monitor or using a different method to access the GPIO states without conflict.
-
Post-Event Handling: Handle the reading of other inputs after the event has been processed. This ensures that the event monitor is not holding the chip open during the read operation.
-
Check Documentation: Review the documentation for
gpiod
to see if there are specific guidelines or functions that allow reading values while an event monitor is active.
These strategies aim to manage the GPIO chip’s state more effectively or restructure your code to ensure that the GPIO chip can be accessed without conflicts during event handling.
Please, also check if these links can help you solve your problem: