 
 int LcdContrast;
 int LcdBrightness = 255;
+
 
 ////////////////////////////////////////////////////////////////////////////////
 // Utility routines


//----------------------------------------
// Define the menu handler routines.
// These actually do the work, everything else is just navigation.
//----------------------------------------

// show a save slot, draw in row 1
void saveslot_show(Menu *menu, int slot_num)
{
  Serial.print("saveslot_show() entered, slot_num="); Serial.println(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");
}

//----------------------------------------
// save the current frequency to a slot
//----------------------------------------

void saveslot_action(Menu *menu, int item_num)
{
  Serial.print("saveslot_action() entered, item_num=");
  Serial.println(item_num);

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

  put_slot(item_num, VfoFrequency, VfoSelectDigit);

//  savresdel_show(menu, item_num);
}

//----------------------------------------
// cycle through the save slots
//----------------------------------------

int saveslot_incdec(int item_num, int delta)
{
  Frequency freq;
  SelOffset offset;

  Serial.print("saveslot_incdec: item_num="); Serial.print(item_num);
  Serial.print(", delta="); Serial.println(delta);

  if (delta != 0)
  {
    Serial.print("Old item_num="); Serial.println(item_num);

    // bump the slot number, limit to [0, 9]
    item_num += delta;
    if (item_num < 0)
      item_num = 0;
    else
      if (item_num > 9)
        item_num = 9;

    Serial.print("New item_num="); Serial.println(item_num);
  }

  // draw the row 1 representation of the value
  Serial.println("Xpoint 1");
  get_slot(item_num, freq, offset);
  Serial.println("Xpoint 2");
  lcd.setCursor(0, 1);
  lcd.write(BlankRow);
  if (VfoFrequency == freq)


void push_event(VFOEvent event)
{
  // put new event into next empty slot
  event_queue[queue_fore] = event;

