Skip to content

FrequencyIn: do not raise in interrupt handler #3867

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

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

dhalbert
Copy link
Collaborator

Fixes #3788.

More info in #3788 (comment):

Remove this mp_raise:

mp_raise_RuntimeError(translate("Frequency captured is above capability. Capture Paused."));
.
This is inside frequencyin_emergency_cancel_capture(), which is called from frequencyin_interrupt_handler(). Interrupt handlers should not raise exceptions.

Simply commenting out the mp_raise_RuntimeError() prevents the crash. The FrequencyIn object is still functional: I tested it with a PWMOut() running at 500Hz and got the expected value.

This is a quick fix to remove the 6.0.0 regression and fatal error; #3788 did not occur in 5.3.1. A more complete solution can be worked out for later. FrequencyIn is still functional with this change.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit eb65765 into adafruit:main Dec 23, 2020
@dhalbert dhalbert deleted the frequencyin-fix-6.0.x branch December 23, 2020 20:30
@dhalbert
Copy link
Collaborator Author

Darn it, I meant to PR this against 6.0.x.

dhalbert added a commit that referenced this pull request Dec 23, 2020
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.

frequencyio.FrequencyIn crash on Metro Grand Central
2 participants