   pinMode(10, INPUT);
 
   Xadow.init();
-  //Xadow.greenLed(LEDON);
 
   oled.init();
   oled.fillScreen(COLOR_BLACK);

      break;
  }

  uint16_t t = millis();
  now += t - checkpoint + 200;
  checkpoint = t;
}

void loop() {
  power_spi_disable();

  if (Xadow.getChrgState() == NOCHARGE) {
    // when on battery power disable usb and uart and
    // sleep for 200 ms
    mcu_disable_usbserial();
    Xadow.goToSleep(SLEEP_MODE_PWR_DOWN, 200);
    // take into account the fact millis isn't ticking over
    // during sleep
    now += 200;
  } else {
    // otherwise simulate sleep using delay and enable
    // usb
    mcu_enable_usbserial();
    delay(200);
  }

  power_spi_enable();
  uint8_t changes = watch_tick(now);
