I am using the TMRh20 libraries (not the MySensors library) and have the same problem. I'm pretty sure that there are interrupts that are not being reset. One of my other symptoms is that when I try to load or reload a program, the program doesn't start.
I have a program program that I run that works most of the time and gets me to the point of being able to reprogram the Arduino
//cli(); // disable all interrupts
WDTCSR = B00011000; // set watchdog timer into configuration mode
WDTCSR = 0; // turn off watchdog time interrupt.
//sei(); // allow interupts
I use this technique to load the program:
write program
use Tool-->port and set the port
on the device, press and hold reset button
<ctl>+u or click on upload icon
when compiling gas gauge is almost complete, release the reset button.
You may have to do 3)-5) several times. You could put:
Serial.begin(9600);
Serial.println("WDT reset");
at the end of the program to know that the device got reset.
I hope this helps you. I, too, would like something a little more controllable.
OSD