diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index 19b71ee..39395c8 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -41,7 +41,7 @@ void DCCWaveform::begin(MotorDriver * mainDriver, MotorDriver * progDriver, byte progTrack.setPowerMode(POWERMODE::OFF); switch (timerNumber) { case 1: interruptTimer= &TimerA; break; -#ifndef ARDUINO_AVR_UNO_WIFI_REV2 +#ifndef ARDUINO_ARCH_MEGAAVR case 2: interruptTimer= &TimerB; break; #ifndef ARDUINO_AVR_UNO case 3: interruptTimer= &TimerC; break; diff --git a/Timer.cpp b/Timer.cpp index 9c6ad3f..53f02dd 100644 --- a/Timer.cpp +++ b/Timer.cpp @@ -62,4 +62,14 @@ ISR(TIMER2_OVF_vect) TimerB.isrCallback(); } -#endif +#elif defined(ARDUINO_AVR_UNO_WIFI_REV2) + +#include "ATMEGA4809/Timer.h" + +Timer TimerA(0); + +ISR(TCA0_OVF_vect) { + TimerA.isrCallback(); +} + +#endif \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index f53a690..565af0f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -65,6 +65,7 @@ lib_deps = mathertel/LiquidCrystal_PCF8574 monitor_speed = 115200 monitor_flags = --echo +build_flags = "-DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO_WIFI_DEV_ED -DARDUINO_ARCH_AVR -DESP_CH_UART -DESP_CH_UART_BR=19200"g [env:uno] platform = atmelavr