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

cpu/sam3: optimize gpio ISR processing #21179

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

dylad
Copy link
Member

@dylad dylad commented Jan 31, 2025

Contribution description

This PR makes use of bitarithm_test_and_clear to process gpio ISR instead of looping through every bits inside the register.
It will use CLZ ARM instruction to catch the position of all bits set and clear them one by one which is faster than checking every bits every time.

Testing procedure

Tested on arduino-due with tests/buttons (I've wired up 4 external buttons with a breadboard for this).

Issues/PRs references

None

Signed-off-by: dylad <dylan.laduranty@mesotic.com>
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jan 31, 2025
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2025
@riot-ci
Copy link

riot-ci commented Feb 5, 2025

Murdock results

✔️ PASSED

193390b cpu/sam3: optimize gpio ISR processing

Success Failures Total Runtime
10271 0 10271 09m:22s

Artifacts

@dylad dylad added this pull request to the merge queue Feb 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 5, 2025
@dylad dylad added this pull request to the merge queue Feb 5, 2025
Merged via the queue into RIOT-OS:master with commit 17bceab Feb 5, 2025
27 checks passed
@dylad dylad deleted the pr/cpu/sam3/optimize_gpio_isr branch February 6, 2025 08:27
@dylad
Copy link
Member Author

dylad commented Feb 6, 2025

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants