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

rp2: Add equivalent of stm32's PendSV pending exception dispatch. #8861

Closed
jimmo opened this issue Jul 5, 2022 · 3 comments
Closed

rp2: Add equivalent of stm32's PendSV pending exception dispatch. #8861

jimmo opened this issue Jul 5, 2022 · 3 comments

Comments

@jimmo
Copy link
Member

jimmo commented Jul 5, 2022

On (for example) stm32, if you press Ctrl-C a second time and the main thread has not picked up the pending exception from the first one, then it schedules a PendSV interrupt to force an NLR with the pending exception.

On rp2, there's only the regular pending exception for keyboard interrupt, so this cannot interrupt e.g. code from the native emitter. (This was raised in the forum where an example was given where the entire app was emit=native and so could never be interrupted unless it called sleep or something else that did mp_handle_pending).

@dpgeorge
Copy link
Member

dpgeorge commented Jul 5, 2022

stm32's pendsv pending exception was something I wanted to get rid of...! It feels like it's more complexity than it's worth. It was there from the very beginning to make ctrl-C work on stm32 before the VM did any polling of a pending exception. Once polling in the VM was added, this "hard ctrl-C" became less useful.

@jimmo
Copy link
Member Author

jimmo commented Jul 5, 2022

Yes, fair! Definitely agree on reducing complexity. It is likely to be a fairly rare situation where the app basically never runs the VM at all (or any other functions that do mp_handle_pending). In this case I think doing something along the lines of #8862 would be more worthwhile.

@iabdalkader
Copy link
Contributor

Just randomly found this issue, and pendsv dispatch has been in rp2 port for while now, introduced in c001cfa I think you can close this issue.

@dpgeorge dpgeorge closed this as completed Apr 4, 2023
tannewt added a commit to tannewt/circuitpython that referenced this issue Jan 31, 2024
cyw43-driver: Update to Adafruit fork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants