<div dir="ltr"><div>Here you go Wilhelm,</div><div><br></div><div><a href="https://github.com/dylanmckay/clang-avr-libc-interrupt-example" target="_blank">https://github.com/dylanmckay/clang-avr-libc-interrupt-example</a></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 5, 2020 at 4:05 AM Wilhelm Meier <<a href="mailto:wilhelm.meier@hs-kl.de">wilhelm.meier@hs-kl.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 04.03.20 um 13:28 schrieb Dylan McKay:<br>
<br>
> <br>
>   * *The C/C++ function needs to be declared with either the calling<br>
>     convention avr-interrupt or avr-non-blocking-interrupt.* Skipping<br>
>     this step will cause regular ret instructions to be emitted for<br>
>     return-from-subroutine, instead of the required reti for interrupt<br>
>     handlers. ISRs also have stricter requirements on which registers<br>
>     must not be clobbered after execution, which the backend will handle<br>
>     properly by restoring all clobbered registers in the interrupt<br>
>     handler epilogue<br>
>   * *The symbol names of the ISR function handlers must match those<br>
>     referred to in avr-libc/avr-libgcc/crt*. This is because the ISR<br>
>     table is specified in assembly inside the GCC AVR CRT. The way it<br>
>     works is that the external symbol references in the CRT object files<br>
>     are declared with an exotic linkage type that causes the linker to<br>
>     skip linking of the symbols if they are undefined references. If you<br>
>     chose a custom ISR table in a custom CRT or runtime library, you<br>
>     would be free to choose ISR names as you pleased.<br>
> <br>
Thank you for your explanation. But I suspect I didn't get it right. Can<br>
you please provide an example?<br>
<br>
Thanks<br>
</blockquote></div>