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

Clear SAMD TAMPER interrupt in pinalarm properly #5708

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

dhalbert
Copy link
Collaborator

  • Fixes DisplayIO not drawing on screen in 7.1.0 Beta 2 #5705.

  • In SAMD, alarm_pin_pinalarm_reset() was clearing the TAMPER interrupt flag with a bitwise operation, instead of just writing a 1 to the right bit, with the rest zeros, using a full register write. The bitwise operation apparently caused the other RTC interrupts to be messed up in some way, and then caused problems with other timing-based operations (probably background task handling), and showed up as displayio problems.

  • Based on the error above, looked for and fixed a few other INTENCLR.bit and INTENSET.bit assignments that should ahve been full-width register writes instead, and found a few. Tested frequencyio to make sure it still works. Did not test watchdog; there is only 1 active bit in that register anyway.

  • Unrelated improvement found when seeing if this was a gc-related bug (which it was not): keypad module dict was mutable, but it could be constant. This was probably a leftover of an earlier version of keypad.

@dhalbert dhalbert linked an issue Dec 13, 2021 that may be closed by this pull request
Copy link
Member

@jepler jepler 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!

@jepler jepler merged commit a0553ea into adafruit:7.1.x Dec 13, 2021
@dhalbert dhalbert deleted the samd-pinalarm-intclr branch December 13, 2021 14:20
@deshipu
Copy link

deshipu commented Dec 13, 2021

I wonder if this also fixes #5476, I will test next weekend.

@tannewt
Copy link
Member

tannewt commented Dec 13, 2021

Interesting find! SVD files have a way to designate registers as writeOneToClear or writeOneToSet. I wonder if I've added this issue elsewhere. It should be fine with set as long as no logic is triggered in the peripheral.

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.

DisplayIO not drawing on screen in 7.1.0 Beta 2
4 participants