Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPIO IRQs are interrupting running JS code #585

Open
skadisch opened this issue Jun 20, 2023 · 2 comments
Open

GPIO IRQs are interrupting running JS code #585

skadisch opened this issue Jun 20, 2023 · 2 comments
Assignees

Comments

@skadisch
Copy link
Contributor

GPIO IRQs registered via "gpio.irq(callback[, event])" are executed as they arrive, interrupting the currently running program. Normally, JavaScript environments are of cooperative nature and schedule events in the event loop where they will be executed when the current task completes.

Further, using IRQs leads to a complete crash / hang, even in simple use cases. Most likely as things are not reentrant / thread safe.

Ignoring that this currently crashes, is it expected to behave like this? If yes, it should be mentioned in the documentation, also pointing out potential risks. If not, I would be happy to provide a PR.

If it is about speed, than at least it should run in an isolated JS context and communicate via messages, like a JS worker.

@communix communix self-assigned this Jun 25, 2023
@communix
Copy link
Collaborator

@skadisch Thank you for using Kaluma. If you can see the crash/hang when you use IRQs, could you please share your code?

@communix
Copy link
Collaborator

@skadisch Which version did you use for the test? Please use the latest FW. Old FWs has IRQ issue.
https://github.com/kaluma-project/kaluma/releases/tag/1.1.0-beta.2

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

No branches or pull requests

2 participants