I feel pretty clumsy asking this question, but I spent several evenings and I'm stuck. please forgive me if I have overseen some obvious things.
I'm trying to use the TimerInterrupt_Generic 1.13.0 with my arduino nano ESP32 board. I've started with a clean system installed the Arduino IDE 2.3.3, added the ESP32 board (detected from the device connected to my windows 11 PC) .
I load an example sketch "Argument_None.ino" from the installed library also the ESP32 version. I hit verify, and it doesn't compile. I get this error:
ESP32TimerInterrupt_Generic.h:450:79: error: macro "attachInterrupt" requires 3 arguments, but only 2 given
bool attachInterrupt(const float& frequency, esp32_timer_callback callback)
Am I doing something wrong here? Is the library already outdated?
Some more background and now I'm drifintg offtopic, but this is the real issue I'm trying to solve:
I'm building a light controller with the use of this library
arduino_dali . Works great on my uno (AVR), but I need BLE and Wifi so moved to a arduino nano ESP32. Good thing someone had an open pullrequest which adds support for the ESP32. however, it uses the library that doesn;t seem to compile.
Plan B is to implement regular interrupts, I don't need to support many platforms but I seem to do something wrong here as well. So if anyone can shoot at this, it would be greatly appreciated.
(btw. plan C is to use the nano for DALI, and the ESP32 for Wifi & BLE and to control the nano)
#ifndef ARDUINO_ARCH_ESP32
// wrapper for interrupt handler
void DaliBus_wrapper_pinchangeISR() { DaliBus.pinchangeISR(); }
void DaliBus_wrapper_timerISR() { DaliBus.timerISR(); }
#else
RPI_PICO_Timer timer2(0);
#endif
...
#ifdef ARDUINO_ARCH_ESP32
attachInterrupt(digitalPinToInterrupt(rxPin), []() -> void {
DaliBus.pinchangeISR();
}, CHANGE);
float frequenz = 1 / DALI_TE;
timer2.attachInterrupt(2398, [](repeating_timer *t) -> bool {
DaliBus.timerISR();
return true;
});
#else
attachPinChangeInterrupt(digitalPinToPinChangeInterrupt(rxPin), DaliBus_wrapper_pinchangeISR, CHANGE);
// Timer setup
Timer1.initialize(DALI_TE); // set timer to time of one half-bit
Timer1.attachInterrupt(DaliBus_wrapper_timerISR);
#endif
}