Hello,
When using the ENCODER_OPTIMIZE_INTERRUPTS statement, the file utility/interrupt_config.h is used.
In this file, the following macro l.6 is used to redefine the attachInterrupt method:
The issue is that it interferes with other uses of this method name like with the TimerOne & TimerThree libraries. In these libraries, the attachInterrupt method only takes one argument but as the previous macro is not scoped, it is used as well in the Timer libraries. So the compiler throws that kind of errors:
Arduino/libraries/TimerThree/TimerThree.h:141:39: error: macro "attachInterrupt" requires 3 arguments, but only 1 given
void attachInterrupt(void (*isr)()) __attribute__((always_inline)) {
^
A simple workaround would be to replace the attachInterrupt method in the Timer libraries by something like attachInterruptHandler or attachInterruptFunction but it will break the API and Arduino users are already used to that name.
But the issue is caused by the Encoder library so it would be better to fix that in this library.
Hello, When using the ENCODER_OPTIMIZE_INTERRUPTS statement, the file
utility/interrupt_config.h
is used. In this file, the following macro l.6 is used to redefine theattachInterrupt
method:The issue is that it interferes with other uses of this method name like with the TimerOne & TimerThree libraries. In these libraries, the
attachInterrupt
method only takes one argument but as the previous macro is not scoped, it is used as well in the Timer libraries. So the compiler throws that kind of errors:A simple workaround would be to replace the
attachInterrupt
method in the Timer libraries by something likeattachInterruptHandler
orattachInterruptFunction
but it will break the API and Arduino users are already used to that name.But the issue is caused by the Encoder library so it would be better to fix that in this library.
Sincerely,
Romain