leOS - un semplice OS per schedulare piccoli task

pablos:
//reset the MCU
void leOS2::reset(void) {
wdt_disable();
//wdt_enable(WDTO_30MS); //riga originale blocco
//wdt_enable(WDTO_4S); //blocco 2560
//wdt_enable(WDTO_2S); //blocco 2560
//wdt_enable(WDTO_1S); //blocco 2560
//wdt_enable(WDTO_500MS); //blocco 2560
//wdt_enable(WDTO_250MS); //blocco 2560
while(1){}; //wait for reset

chiaramente chiudendo e riaprendo a ogni cambiamento l'IDE, la prima volta lo scrive, poi non riesco più a caricare nulla se non riaccendendo arduino tenendo premuto il reset ecc ecc

Allora il problema è il bootloader, come temevo, che non usando il WDT, lo lascia attivo.
La cosa che mi fa pensare è qui:
http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html
si legge:

Note that for newer devices (ATmega88 and newer, effectively any AVR that has the option to also generate interrupts), the watchdog timer remains active even after a system reset (except a power-on condition), using the fastest prescaler value (approximately 15 ms). It is therefore required to turn off the watchdog early during program startup

Quello che ti ho chiesto di fare è appunto di impostare un tempo superiore ai 15 ms, che doveva escludere il problema del watchdog che restava attivo. Ma così però non è.