 void mcb_backlight(MenuItem* pmi){
   //
   //EEPROM.update(ADDR_BRIGHTNESS, brightness);
+  exit_menu=1;
 }
 
 void mcb_retirement_year(MenuItem* pmi);

  analogWrite(PinBacklight, brightness);

  // configure clock to use RTC
  if(! RTC.read(tm)){
    // RTC isn't working
    while(true){

void mcb_retirement_day(MenuItem* pmi);
void mcb_retirement_day(MenuItem* pmi){
  //
}

void more_bright(){
  if( brightness >= BrightMax ){
    brightness = BrightMax;
  }
  analogWrite(PinBacklight, brightness);
}

void less_bright(){
  if( brightness >= BrightMax ){
    brightness = BrightMax;
  }
  analogWrite(PinBacklight, brightness);
}

void menuLoop(){
  exit_menu = 0;
  Menu const* cm;
  // we came here due to a button press; wait for it to come back up.
  wait_for_button_release();
  int prevbutton = btnNONE;
  while(!exit_menu){
    cm = ms.get_current_menu();
    update_lcd(
      "m:" + String(cm->get_name()),
      cm->get_selected()->get_name()
      );
    switch (prevbutton = read_LCD_buttons()){
      case btnNONE: {
        break;
      }
      case btnRIGHT: {
        ms.next();
        break;
      }
      case btnLEFT: {
        ms.prev();
        break;
      }
      case btnUP: {
        ms.back();
        break;
      }
      case btnDOWN: {
        break;
      }
      case btnSELECT: {
        ms.select();
        break;
      }
    }
    if( prevbutton != btnNONE ){
      wait_for_button_release();
    }
  }
}

// delay() ties the processor up. This should mostly avoid that.
void pause(unsigned long d){
  unsigned long start_milli = millis();
  while( millis() - start_milli < d ){
    // nothin'  
  }
}

void setup() {
