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

[extint] Adds external interrupt support for SAM #436

Merged
merged 3 commits into from
Jul 20, 2020

Conversation

henrikssn
Copy link
Contributor

Solves #435

Let me know if you have any feedback on the approach, I am green-fielding this area and it would be cool if we could eventually match the interrupt implementations for the other platforms to this.

The end goal would be to be able to compile the example added in this PR for any platform that supports interrupts.

src/modm/platform/extint/sam/extint.cpp Outdated Show resolved Hide resolved
src/modm/platform/extint/sam/module.lb Outdated Show resolved Hide resolved
src/modm/platform/extint/sam/extint.cpp Outdated Show resolved Hide resolved
src/modm/platform/extint/sam/extint.cpp Show resolved Hide resolved
examples/samd/interrupt/main.cpp Outdated Show resolved Hide resolved
examples/samd/interrupt/main.cpp Show resolved Hide resolved
@salkinium
Copy link
Member

An advanced alternative to allocating the function at runtime would be to place the function addresses into a linker section (analog to how MODM_HARDWARE_INIT works) and run through that list in the interrupt. That would delegate memory allocation for this to the linker, but it would not allow for runtime addition/removal, but you could allocate RAM space (based on the list size) for a bit vector to enable/disable each handler separately at runtime.

However, you could probably get 90% there with an lbuild configurable handler list in RAM, so… 🤷‍♂️

examples/samd/interrupt/main.cpp Show resolved Hide resolved
src/modm/platform/clock/sam/gclk.hpp Outdated Show resolved Hide resolved
src/modm/platform/extint/sam/extint.cpp Outdated Show resolved Hide resolved
src/modm/platform/extint/sam/extint.cpp Show resolved Hide resolved
src/modm/platform/extint/sam/module.lb Outdated Show resolved Hide resolved
Copy link
Contributor Author

@henrikssn henrikssn left a comment

Choose a reason for hiding this comment

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

Not sure what is up with CI, I hope it is not my fault :)

src/modm/platform/extint/sam/extint.cpp Show resolved Hide resolved
src/modm/platform/extint/sam/module.lb Outdated Show resolved Hide resolved
src/modm/platform/clock/sam/gclk.hpp Outdated Show resolved Hide resolved
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

I'm ok to merge this if you are (and I understand what's wrong in the CI).

@henrikssn
Copy link
Contributor Author

SGTM, ready to merge.

@salkinium salkinium merged commit cbce428 into modm-io:develop Jul 20, 2020
@henrikssn henrikssn deleted the feature/sam-interrupt branch July 29, 2020 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants