 int LcdBrightness = DefaultLcdBrightness;
 
 // adjustment value for DDS-60 (set in 'Calibrate' menu)
-int VfoClockOffset = 0;
+int VfoClockOffset = DefaultVfoClockOffset;
 
 // global pointing to symbol for current battery state
 byte *BatterySymbol = battunder;

                                  // BMS disconnects at around 6.40v
const float NoBattVoltage = 5.5;  // if at or below this, no battery

// macro to get number of elements in an array
#define ALEN(a)    (sizeof(a)/sizeof((a)[0]))


}

//----------------------------------------
// Adjust the voltage divider calibrate value to adjust displayed voltage.
//   menu      address of 'calling' menu
//   item_num  index of MenuItem we were actioned from
// Show the measured voltage as we adjust the calibration value.
//
// In line with all other action menuitems we want to observer the effects
// of changing the value, but also only want to make a permanent change on
// a 'click' action only.
//----------------------------------------

void volts_calibrate_action(struct Menu *menu, int item_num)
{
  int save_calibrate = VoltsCalibrate;  // save the existing value
  int seldig = 0;                       // the selected digit in the display

  // get rid of any stray events to this point
  event_flush();

  // draw row 0 of menu, get heading from MenuItem
  lcd.clear();
  lcd.print(menu->items[item_num]->title);

  // show offset info on row 1
  display_sel_offset(VoltsCalibrate, seldig, 5, 10, 1);

  // handle events in our own little event loop
  while (true)
  {
    // handle any pending event
    if (event_pending() > 0)
    {
      byte event = event_pop(); // get next event and handle it

      switch (event)
      {
        case vfo_RLeft:
          VoltsCalibrate -= offset2bump[seldig];
          if (VoltsCalibrate < MinVoltsCalibrate)
            VoltsCalibrate = MinVoltsCalibrate;
#if (DEBUG & DEBUG_ACT)
          Serial.printf(F("volts_calibrate_action: vfo_RLeft, after VoltsCalibrate=%d\n"),
                        VoltsCalibrate);
#endif
          break;
        case vfo_RRight:
          VoltsCalibrate += offset2bump[seldig];
          if (VoltsCalibrate > MaxVoltsCalibrate)
            VoltsCalibrate = MaxVoltsCalibrate;
#if (DEBUG & DEBUG_ACT)
          Serial.printf(F("volts_calibrate_action: vfo_RRight, after VoltsCalibrate=%d\n"),
                        VoltsCalibrate);
#endif
          break;
        case vfo_DnRLeft:
#if (DEBUG & DEBUG_ACT)
          Serial.printf(F("volts_calibrate_action: vfo_DnRLeft\n"));
#endif
          ++seldig;
          if (seldig >= MaxOffsetDigits)
            seldig = MaxOffsetDigits - 1;
#if (DEBUG & DEBUG_ACT)
          Serial.printf(F("volts_calibrate_action: vfo_DnRLeft, after seldig=%d\n"),
                        seldig);
#endif
          break;
        case vfo_DnRRight:
#if (DEBUG & DEBUG_ACT)
          Serial.printf(F("volts_calibrate_action: vfo_DnRLeft\n"));
#endif
          --seldig;
          if (seldig < 0)
            seldig = 0;
#if (DEBUG & DEBUG_ACT)
          Serial.printf(F("volts_calibrate_action: vfo_DnRRight, after seldig=%d\n"),
                        seldig);
#endif
          break;
        case vfo_Click:
          save_calibrate = VoltsCalibrate; // for when we exit menuitem
          display_flash();
          break;
        case vfo_HoldClick:
          // put changed VoltsCalibrate into EEPROM
          VoltsCalibrate = save_calibrate;
          save_to_eeprom();             // save changes to EEPROM
          event_flush();
          return;
        default:
          // ignored events we don't handle
          break;
      }

      // show hold time value in row 1
      display_sel_offset(VoltsCalibrate, seldig, 5, 10, 1);
    }
  }
}

//----------------------------------------
// Toggle the VFO mode: vfo_Online or vfo_Standby.
//
// Note that DDS-60 only updates if VfoMode is vfo_Online.
