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

[stm32] Interrupt handler indirection causes unnecessary latency #963

Closed
strongly-typed opened this issue Feb 25, 2023 · 1 comment · Fixed by #964
Closed

[stm32] Interrupt handler indirection causes unnecessary latency #963

strongly-typed opened this issue Feb 25, 2023 · 1 comment · Fixed by #964

Comments

@strongly-typed
Copy link
Collaborator

MODM_ISR(DMA1_Channel{{N}}) calls nothing but Dma1::Channel<DmaBase::Channel::Channel{{N}}>::interruptHandler(); in dma.cpp.in

Unfortunately, these calls are not inlined. Adding an inline did not change anything for me. These calls are real calls, increasing interrupt latency unnecessarily.

InterruptHandler is a jinja-generated C++ template ...

Why not jinja-generate this code directly into dma.cpp without the C++ template?

(Yes, I have to shave off some nanoseconds IRQ latency and I try to stay with modm for convenience.)

@chris-durand
Copy link
Member

You could try adding [[gnu::always_inline]] at the definition of interruptHandler(). That should force inlining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants