   }
 }
 
+//----------------------------------------
+// Toggle the VFO mode: vfo_Online or vfo_Standby.
+//----------------------------------------
+void vfo_toggle_mode(void)
+{
+  if (VfoMode == vfo_Online)
+  {
+    // DDS goes into standby, change mode
+    dds_standby();
+    VfoMode = vfo_Standby;
+  }
+  else
+  {
+    // DDS goes online, change mode
+    dds_online();
+    VfoMode = vfo_Online;
+  }
+
+  // update display
+  lcd.setCursor(0, 1);
+  lcd.write(BlankRow);
+  lcd.setCursor(0, 1);
+  lcd.write(mode2display(VfoMode));
+}
 
 //----------------------------------------
 // Reset menu

{
  // initialize the serial console
  Serial.begin(115200);

  // initialize the display
  lcd.begin(NUM_COLS, NUM_ROWS);      // define display size

const unsigned int DefaultLcdContrast = 70;
const unsigned int DefaultLcdBrightness = 150;

// VFO modes - online or standby
#define vfo_Standby   0
#define vfo_Online    1

//##############################################################################
// The VFO state variables and typedefs
//##############################################################################

typedef unsigned int Mode;
Mode VfoMode;               // VFO mode

typedef unsigned long Frequency;
Frequency VfoFrequency;     // VFO frequency (Hz)
