Skip to content

Fixes SAMD PDMIn#5842

Merged
tannewt merged 1 commit intoadafruit:mainfrom
dhalbert:pdmin-fix
Jan 12, 2022
Merged

Fixes SAMD PDMIn#5842
tannewt merged 1 commit intoadafruit:mainfrom
dhalbert:pdmin-fix

Conversation

@dhalbert
Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert commented Jan 12, 2022

SAMD PDMIn has not worked right for a while.

  • The main problem was that the needed IRQ was never actually enabled.
  • Made a flag variable volatile, as it should have been.
  • Called to pdmin_reset() was commented out, maybe left over from some debugging.

I will probably backport this to 7.1.x, but there is maybe one other unrelated regression that should be checked for a 7.1.1 release first.

@dhalbert dhalbert requested review from jepler and tannewt January 12, 2022 16:47
Copy link
Copy Markdown
Member

@ladyada ladyada left a comment

Choose a reason for hiding this comment

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

didnt test but.... is there any linter that will warn if irq code is accessing a non-volatile variable? i feel like its such a killer bug that keeps popping up in microcontroller code :/

@dhalbert
Copy link
Copy Markdown
Collaborator Author

didnt test but.... is there any linter that will warn if irq code is accessing a non-volatile variable? i feel like its such a killer bug that keeps popping up in microcontroller code :/

Totally agree. I looked at the ones in https://github.com/caramelomartins/awesome-linters and also did some general searching; I could not find any checkers, but it would not be so hard as long as IRQ routines were labeled as such.

Copy link
Copy Markdown
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 for the fix!

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.

metro-m4 call to PDMIn.record() never returns

3 participants