 
   analogWrite(mc_Brightness, LcdBrightness);
   Serial.print("Set brightness to "); Serial.println(LcdBrightness);
-  action_flash();  
+  menu_flash();  
 }
 
 //----------------------------------------------------------

    LcdContrast = 125;
  analogWrite(mc_Contrast, LcdContrast);
  Serial.print("Set contrast to "); Serial.println(LcdContrast);
  action_flash();
}

void brightness_select(struct Menu *menu, int slot_num)

  lcd.write("Hz");
}

// save the current frequency to a slot
void saveslot_action(Menu *menu, int item_num)
{
  Serial.println("saveslot_action() entered");

  // display an 'action' flash
  menu_flash();

  put_slot(item_num, VfoFrequency, VfoSelectDigit);

  savresdel_show(menu, item_num);
}

// restore the current frequency from a slot
void restoreslot_show(Menu *menu, int item_num)
{
  Serial.println("restoreslot_show() entered");

  // display an 'action' flash
  menu_flash();

  get_slot(item_num, VfoFrequency, VfoSelectDigit);

  savresdel_show(menu, item_num);  
}

// delete the frequency in a slot
void deleteslot_show(Menu *menu, int item_num)
{
  Serial.println("deleteslot_show() entered");

  // display an 'action' flash
  menu_flash();

  put_slot(item_num, 0L, 0);

  savresdel_show(menu, item_num);    
}

// increase/decrease the display brightness
void set_brightness(Menu *menu, int item_num)
{
  Serial.println("set_brightness() entered");

  
}

// increase/decrease the display contrast
void set_contrast(Menu *menu, int item_num)
{
  Serial.println("set_contrast() entered");

  
}

//-----
// settings menu
//-----

#ifdef JUNK
struct MenuItem mi_brightness = {"Brightness", NULL, set_brightness, NULL};
struct MenuItem mi_contrast = {"Contrast", NULL, set_contrast, NULL};
struct MenuItem *mia_settings[] = {&mi_brightness, &mi_contrast};

//#define NumSettingsMenuItems (sizeof(mia_settings)/sizeof(struct MenuItem *))

struct Menu settings_menu = {"Settings", ARRAY_LEN(mia_settings), mia_settings};

//-----
// "save slot" menu
//-----

struct MenuItem mi_saveslot = {NULL, NULL, saveslot_action, saveslot_show};
struct MenuItem *mia_saveslot[] = {&mi_saveslot};

struct Menu saveslot_menu = {"Save slot", ARRAY_LEN(mia_saveslot), mia_saveslot};

//-----
// main menu
//-----

struct MenuItem save = {"Save slot", &saveslot_menu, &menu_show, NULL};
struct MenuItem restore = {"Restore slot", NULL, &menu_show, NULL};
struct MenuItem del = {"Delete slot", NULL, &menu_show, NULL};
struct MenuItem settings = {"Settings", &settings_menu, &menu_show, NULL};
struct MenuItem *m_menu[] = {&save, &restore, &del, &settings};

//#define NumMainMenuItems (sizeof(m_menu)/sizeof(struct MenuItem *))
//#define NumMainMenuItems ARRAY_LEN(m_menu)

struct Menu main_menu = {"Menu", ARRAY_LEN(m_menu), m_menu};
#endif

void alphaalpha_action(Menu *menu, int slot_num)
{
  Serial.print("alphaalpha_action: menu=");
  Serial.print((unsigned long) menu);
  Serial.print(", slot_num=");
  Serial.println(slot_num);
}

#define MaxSlotNum 10

int alphaalpha_incdec(int slot_num, int delta)
{
  Serial.print("alphaalpha_incdec: slot_num=");
  Serial.println(slot_num);

  // first, bump the internal index, limit to range
  slot_num += delta;
  if (slot_num < 0)
    slot_num = 0;
  else
    if (slot_num >= MaxSlotNum)
      slot_num = MaxSlotNum - 1;

  Serial.print("alphaalpha_incdec: drawing bar length ");
  Serial.println(slot_num + 1);
//  lcd.write(ALLSET_CHAR);
  // draw the row 1 reresentation of the value
  lcd.setCursor(0, 1);
  lcd.write(BlankRow);
  lcd.setCursor(0, 1);
  for (int i = 0; i <= slot_num; ++i)
  {
    lcd.write(ALLSET_CHAR);
  }
  
  Serial.print("alphaalpha_action: returning ");
  Serial.println(slot_num);
  
  return slot_num;
}

struct MenuItem mi_alphaalpha = {NULL, NULL, NULL, alphaalpha_incdec};
struct MenuItem *mia_alphaalpha[] = {&mi_alphaalpha};
struct Menu alpha_alpha_menu = {"AlphaAlpha", ARRAY_LEN(mia_alphaalpha), mia_alphaalpha};

struct MenuItem mi_alpha1 = {"Alpha1", &alpha_alpha_menu, &menu_show, NULL};
struct MenuItem mi_beta1 = {"Beta1", NULL, NULL, NULL};
struct MenuItem mi_gamma1 = {"Gamma1", NULL, NULL, NULL};
struct MenuItem mi_delta1 = {"Delta1", NULL, NULL, NULL};
struct MenuItem *mia_alpha[] = {&mi_alpha1, &mi_beta1, &mi_gamma1, &mi_delta1};
struct Menu alpha_menu = {"Alpha", ARRAY_LEN(mia_alpha), mia_alpha};

struct MenuItem mi_alpha2 = {"Alpha2", NULL, NULL, NULL};
struct MenuItem mi_beta2 = {"Beta2", NULL, NULL, NULL};
struct MenuItem mi_gamma2 = {"Gamma2", NULL, NULL, NULL};
struct MenuItem mi_delta2 = {"Delta2", NULL, NULL, NULL};
struct MenuItem *mia_beta[] = {&mi_alpha2, &mi_beta2, &mi_gamma2, &mi_delta2};
struct Menu beta_menu = {"Beta", ARRAY_LEN(mia_beta), mia_beta};

struct MenuItem mi_alpha3 = {"Alpha3", NULL, NULL, NULL};
struct MenuItem mi_beta3 = {"Beta3", NULL, NULL, NULL};
struct MenuItem mi_gamma3 = {"Gamma3", NULL, NULL, NULL};
struct MenuItem mi_delta3 = {"Delta3", NULL, NULL, NULL};
struct MenuItem *mia_gamma[] = {&mi_alpha3, &mi_beta3, &mi_gamma3, &mi_delta3};
struct Menu gamma_menu = {"Gamma", ARRAY_LEN(mia_gamma), mia_gamma};

struct MenuItem mi_alpha4 = {"Alpha4", NULL, NULL, NULL};
struct MenuItem mi_beta4 = {"Beta4", NULL, NULL, NULL};
struct MenuItem mi_gamma4 = {"Gamma4", NULL, NULL, NULL};
struct MenuItem mi_delta4 = {"Delta4", NULL, NULL, NULL};
struct MenuItem *mia_delta[] = {&mi_alpha4, &mi_beta4, &mi_gamma4, &mi_delta4};
struct Menu delta_menu = {"Delta", ARRAY_LEN(mia_delta), mia_delta};

struct MenuItem mi_alpha = {"Alpha", &alpha_menu, &menu_show, NULL};
struct MenuItem mi_beta = {"Beta", &beta_menu, &menu_show, NULL};
struct MenuItem mi_gamma = {"Gamma", &gamma_menu, &menu_show, NULL};
struct MenuItem mi_delta = {"Delta", &delta_menu, &menu_show, NULL};
struct MenuItem *mia_test[] = {&mi_alpha, &mi_beta, &mi_gamma, &mi_delta};
struct Menu test_menu = {"Menu", ARRAY_LEN(mia_test), mia_test};


// draw the Save, Restore or Delete screen
void savresdel_show(struct Menu *menu, int slot_num)
{
  Frequency freq;
  SelOffset offset;

  // max length of item strings is "9: xxxxxxxxHz" - 13 chars
  const int max_len = 13;
  char buf[MAX_FREQ_CHARS + 1];

  get_slot(slot_num, freq, offset);

  ltochbuff(buf, MAX_FREQ_CHARS, freq);
  buf[MAX_FREQ_CHARS] = 0;

  // write menu title on first row
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.write(menu->title);

  // write indexed item on lower row, right-justified
  lcd.setCursor(0, 1);
  lcd.write(BlankRow);
  // show '*' if slot frequency equal to current
  if (freq == VfoFrequency)
  {
    lcd.setCursor(0, 1);
    lcd.write("*");
  }
  lcd.setCursor(NUM_COLS - max_len, 1);
  lcd.write(slot_num + '0');
  lcd.write(": ");
  lcd.write(buf);
  lcd.write("Hz");
}

void save_select(struct Menu *menu, int slot_num)
{
  savresdel_show(menu, slot_num);

  while (true)
  {
    
  }
  // display an 'action flash'
  menu_flash();
  
  put_slot(slot_num, VfoFrequency, VfoSelectDigit);

  savresdel_show(menu, slot_num);
}

void restore_select(struct Menu *menu, int slot_num)
{
  // display an 'action flash'
  menu_flash();
  
  get_slot(slot_num, VfoFrequency, VfoSelectDigit);

//  savresdel_show(menu, slot_num);  NOT NEEDED?
}

void delete_select(struct Menu *menu, int slot_num)
{
  // display an 'action flash'
  menu_flash();
  
  put_slot(slot_num, 0L, 0);

//  savresdel_show(menu, slot_num);  NOT NEEDED?
}

void contrast_select(struct Menu *menu, int slot_num)
