 uint32_t volatile msraw = 0x80000000;
 #define MIN_REPEAT_PERIOD   2
 bool volatile PenDown = false;
+
+//VFOState vfo_state = VFO_Standby;
+VFOState vfo_state = VFO_Online;
 
 
 //-----------------------------------------------

// Draw the basic screen
//-----------------------------------------------

#if 0
void drawOnline(void)
{
  tft.fillRoundRect(ONLINE_X, ONLINE_Y, ONLINE_WIDTH, ONLINE_HEIGHT, BUTTON_RADIUS, ONLINE_BG);
  tft.setCursor(ONLINE_X + 2, ONLINE_Y + 2);
  tft.print("ONLINE");
}

void drawMenu(void)
{
  tft.fillRoundRect(MENU_X, MENU_Y, MENU_WIDTH, MENU_HEIGHT, BUTTON_RADIUS, MENU_BG);
  tft.setCursor(MENU_X + 2, MENU_Y + 2);
  tft.print("MENU");
}
#endif

void draw_screen(void)
{
  // start drawing things that don't change
  tft.fillScreen(SCREEN_BG2);
  tft.setTextWrap(false);
  tft.fillRect(0, 0, tft.width(), DEPTH_FREQ_DISPLAY, FREQ_BG);
#if 0
  tft.drawRect(0, 0, tft.width(), DEPTH_FREQ_DISPLAY, SCREEN_BG1);
  tft.drawRect(1, 1, tft.width()-2, DEPTH_FREQ_DISPLAY-2, SCREEN_BG2);
  tft.drawRect(2, 2, tft.width()-4, DEPTH_FREQ_DISPLAY-4, SCREEN_BG3);
#endif
  tft.setCursor(MHZ_OFFSET_X, FREQ_OFFSET_Y);
  tft.setTextColor(FREQ_FG);
  tft.print("Hz");

//  drawOnline();
//  drawMenu();
}

//-----------------------------------------------

//-----------------------------------------------
void loop()
{
//  drawOnline();

 // handle all events in the queue
  while (true)
  {
    // get next event and handle it
