   Serial.printf("display_flash: called\n");
 }
 
-//////////////////////////////////////////////////////////////////////////////
-// Code to handle the 'frequency' widget at screen top
-//////////////////////////////////////////////////////////////////////////////
-
-//-----------------------------------------------
-// Draw the frequency byte buffer to the screen.
-//     select  index of digit to highlight
-//
-// Updates all digits on the screen.  Skips leading zeros.
-//-----------------------------------------------
-
-void freq_show(int select=-1)
-{
-  bool leading_space = true;
-
-  tft.setFont(FONT_FREQ);
-  
-  for (int i = 0; i < NUM_F_CHAR; ++i)
-  {
-    if (i == select)
-      tft.fillRect(freq_char_x_offset[i], 2, CHAR_WIDTH+2, DEPTH_FREQ_DISPLAY-4, FREQ_SEL_BG);
-    else
-      tft.fillRect(freq_char_x_offset[i], 2, CHAR_WIDTH+2, DEPTH_FREQ_DISPLAY-4, FREQ_BG);
-                   
-    if ((freq_display[i] != '0') || !leading_space)
-    {
-      tft.drawChar(freq_char_x_offset[i], FREQ_OFFSET_Y, freq_display[i], FREQ_FG, FREQ_BG, 1);
-      leading_space = false;
-    }
-  }
-}
-
-//-----------------------------------------------
-// Unselect a digit in the frequency display.
-//     select  index of digit to unselect
-//-----------------------------------------------
-
-void freq_unselect(int select)
-{
-  Serial.printf("freq_unselect: select=%d\n", select);
-  tft.fillRect(freq_char_x_offset[select]-1, 2,
-               CHAR_WIDTH+1, DEPTH_FREQ_DISPLAY-4, FREQ_BG);
-  tft.setFont(FONT_FREQ);
-  tft.drawChar(freq_char_x_offset[select], FREQ_OFFSET_Y,
-               freq_display[select], FREQ_FG, FREQ_BG, 1);
-}
-
-//-----------------------------------------------
-// Fills the frequency char buffer from a given frequency.
-//
-//     buff  address of char buffer to fill
-//     freq  the frequency to put into the buffer
-//
-// Fills the buffer from the left with MSB first.
-//-----------------------------------------------
-
-void freq_to_buff(char *buff, unsigned long freq)
-{
-  int rem;
-
-  for (int i = NUM_F_CHAR - 1; i >= 0; --i)
-  {
-    rem = freq % 10;
-    freq = freq / 10;
-    buff[i] = '0' + rem;
-  }
-}
-
-//-----------------------------------------------
-// Gets an integer frequency from the frequency char buffer.
-//     buff  address of char buffer to fill
-//
-// Returns the buffer value as an unsigned long value.
-//-----------------------------------------------
-
-unsigned long freq_to_int(char *buff)
-{
-  unsigned long result = 0;
-
-  for (int i = 0; i < NUM_F_CHAR; ++i)
-  {
-    result = result * 10 + freq_display[i] - '0';
-  }
-
-  
-  return result;
-}
-
-//-----------------------------------------------
-// Draw the frequency 'thousands' markers
-//-----------------------------------------------
-
-void draw_thousands(void)
-{
-  tft.fillRect(FREQ_OFFSET_X+CHAR_WIDTH*2, 44, 2, 6, FREQ_FG);
-  tft.fillRect(FREQ_OFFSET_X+CHAR_WIDTH*5, 44, 2, 6, FREQ_FG);
-}
+//-----------------------------------------------
+// Menuitem action handlers
+//-----------------------------------------------
+
+void reset_no_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("reset_no_action: called\n"));
+}
+
+void reset_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("reset_action: called\n"));
+}
+
+void brightness_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("brightness_action: called\n"));
+}
+
+void calibrate_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("calibrate_action: called\n"));
+}
+
+void saveslot_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("saveslot_action: called\n"));
+}
+
+void restoreslot_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("credits_action: called\n"));
+}
+
+void deleteslot_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("restoreslot_action: called\n"));
+}
+
+void credits_action(struct Menu *menu, int item_num)
+{
+  Serial.printf(F("credits_action: called\n"));
+}
+
+//-----------------------------------------------
+// Define the PixelVFO menu system
+//-----------------------------------------------
+
+struct MenuItem mi_reset_no = {"No", NULL, &reset_no_action};
+struct MenuItem mi_reset_yes = {"Yes", NULL, &reset_action};
+struct MenuItem *mia_reset[] = {&mi_reset_no, &mi_reset_yes};
+struct Menu reset_menu = {"Reset all", ALEN(mia_reset), mia_reset};
+
+struct MenuItem mi_brightness = {"Brightness", NULL, &brightness_action};
+struct MenuItem mi_calibrate = {"Calibrate", NULL, &calibrate_action};
+struct MenuItem *mia_settings[] = {&mi_brightness, &mi_calibrate};
+struct Menu settings_menu = {"Settings", ALEN(mia_settings), mia_settings};
+
+struct MenuItem mi_saveslot = {"Save slot", NULL, &saveslot_action};
+struct MenuItem mi_restoreslot = {"Restore slot", NULL, &restoreslot_action};
+struct MenuItem mi_deleteslot = {"Delete slot", NULL, &deleteslot_action};
+struct MenuItem *mia_slots[] = {&mi_saveslot, &mi_restoreslot, &mi_deleteslot};
+struct Menu slots_menu = {"Slots", ALEN(mia_slots), mia_slots};
+
+struct MenuItem mi_slots = {"Slots", &slots_menu, NULL};
+struct MenuItem mi_settings = {"Settings", &settings_menu, NULL};
+struct MenuItem mi_reset = {"Reset all", &reset_menu, NULL};
+struct MenuItem mi_credits = {"Credits", NULL, &credits_action};
+struct MenuItem *mia_main[] = {&mi_slots, &mi_settings, &mi_reset, &mi_credits};
+struct Menu menu_main = {"Menu", ALEN(mia_main), mia_main};
 
 //////////////////////////////////////////////////////////////////////////////
 // Code to handle the 'online' and 'menu' buttons.

}

//////////////////////////////////////////////////////////////////////////////
// Code to handle the PixelVFO menus
//////////////////////////////////////////////////////////////////////////////


#define MENU_HEIGHT         35
#define MENU_X              (ts_width - MENU_WIDTH)
#define MENU_Y              (ts_height - MENU_HEIGHT)
#define MENU_BG             ILI9341_BLACK
#define MENU_BG2            ILI9341_GREEN
#define MENU_FG             ILI9341_BLUE

// constants for the menu system
#define MENUITEM_HEIGHT     35
