Hello.
I am having watchdog callback setting problem with Arduino UNO Wifi Rev2.
I need to eeprom update using watchdog callback(ISR) before board's reset.
That's why I want to WDIE bit setting.
Below is my simple test code.
------------------------------------code-----------------------------------------------------------
#include <avr/wdt.h>
void setup() {
wdt_enable(WDTO_2S);
WDTCSR |= (1 << WDIE); // set the WDIE flag to enable interrupt callback function.
}
ISR(WDT_vect)
{
//update eeprom
}
void loop() {
}
When I compile, I got this error message.
-------------------------------------error message-----------------------------------------------
Arduino: 1.8.9 (Windows 7), Board: "Arduino Uno WiFi Rev2, None (ATMEGA4809)"
C:\Users\User\Documents\Arduino\wdt_test\wdt_test.ino: In function 'void setup()':
wdt_test:5:3: error: 'WDTCSR' was not declared in this scope
WDTCSR |= (1 << WDIE); // set the WDIE flag to enable interrupt callback function.
^
wdt_test:5:19: error: 'WDIE' was not declared in this scope
WDTCSR |= (1 << WDIE); // set the WDIE flag to enable interrupt callback function.
^
exit status 1
'WDTCSR' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I tried same code with Arduino UNO. It's fine.
Can anybody help me solve this problem with Wifi rev2? (Atmega4809)