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

A hook-based way to use redstone interface #244

Open
heipiao233 opened this issue Sep 25, 2022 · 5 comments
Open

A hook-based way to use redstone interface #244

heipiao233 opened this issue Sep 25, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@heipiao233
Copy link

Is your feature request related to a problem? Please describe.
Sometimes we have to listen many redstone interfaces, so we can do it through polling. But this way is very slow, and if we are listening for short redstone signals like a button, the program may cannot receive the signal.

Describe the solution you'd like
Keep the old way, and add a new way: when the interface receives signal, call the hook function.

Describe alternatives you've considered
No

@heipiao233 heipiao233 added the enhancement New feature or request label Sep 25, 2022
@atirut-w
Copy link

This is impossible with the RISC-V architecture since the OS manages all I/O, devices cannot force the CPU to jump to a function unless it's an interrupt, in which case you'll need a custom kernel.

@heipiao233
Copy link
Author

Is that possible if we write a driver? I just know something about it.

@CoolCat467
Copy link

Would software-hooks be a viable option, or would implementing hooks on top of current system potentially lead to loss of extremely quick signals? If the program is structured well and doesn't hold control for too long, could it not do cooperative multitasking and have event handlers?

@ajh123
Copy link

ajh123 commented Feb 13, 2023

Basically something like an interrupt?

@heipiao233
Copy link
Author

Basically something like an interrupt?

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants