I love this forum. <3
No doubt!
I thought of two caveats with that code...
- To truly be "die" the watchdog needs to be disabled. This should do it...
#include <avr/sleep.h>
#include <avr/wdt.h>
void die( void )
{
wdt_disable();
set_sleep_mode( SLEEP_MODE_PWR_DOWN );
while ( true )
{
sleep_enable();
cli();
sleep_cpu();
}
}
- The output pins will retain their state. Any pins configured OUTPUT / LOW will continue sinking and any pins configured OUTPUT / HIGH will continue sourcing.
I believe everything else will be completely shutdown.