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

support interrupts #1

Open
WebFreak001 opened this issue Mar 23, 2020 · 1 comment
Open

support interrupts #1

WebFreak001 opened this issue Mar 23, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@WebFreak001
Copy link
Owner

WebFreak001 commented Mar 23, 2020

currently interrupts must be done by defining methods using magic names like __vector_4 for interrupt 4 (which needs to be looked up from the specific board header)

In C there is a macro

ISR(INT0_vect)
{
    // code
}

which can achieve this easily.

In D I would like to still provide auto completion support (= not all code as string), while also avoiding wrong usage like trying to call the interrupt as a function (because it returns using reti instead of ret)

A possibility would be a template mixin with a delegate parameter or a function name that gets called. Would still need some work to make it work with betterC (even with CTFE) right now though.

(needs input)

@WebFreak001 WebFreak001 added enhancement New feature or request help wanted Extra attention is needed labels Mar 23, 2020
@ErnyTech
Copy link

ErnyTech commented May 27, 2020

LDC is currently unable to use calling convection for interrupts, we need to set Calling CallingConv::AVR_INTR for non-blocking interrupts and CallingConv::AVR_SIGNAL for blocking interrupts (See https://llvm.org/doxygen/CallingConv_8h_source.html).

I am working on several patches for LDC including this one to improve support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants