 void iowait()
 {
   uint32_t start = RTC::micros();
-  yield();
-  idle += (RTC::micros() - start);
+  Power::sleep(); 
+  uint32_t stop = RTC::micros();
+  idle = idle + (stop - start);
 }
 
 void setup()

#include "Commands.h"
#include "Cosa/RTC.hh"
#include "Cosa/Tone.hh"
#include "Cosa/Watchdog.hh"
#include "Cosa/IOStream/Driver/UART.hh"


  Tone::begin();
  RTC::begin();
  uart.begin(9600);
  yield = iowait;
}

void loop()
{
  shell.run(ios);
  yield();
}

