 
 //----------------------------------------
 // Abort the program.
-// Tries to tell the world what went wrong, then just loops.
+// Tries to tell the world what went wrong.
 //     msg  address of error string
 // Only first NumRows*NumCols chars of message is displayed on LCD.
 //----------------------------------------

    strncpy(buf + strlen(msg), "                                ",
            NumCols*NumRows - strlen(msg));

  // show what we can on the display, forever
  while (1)
  {
    lcd.clear();
    for (int i = 0; i < NumRows; ++i)
    {
      lcd.setCursor(0, i);
      lcd.print(buf + i*NumCols);
    }
    delay(2000);

    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print(" ");   // padding to centre name+version
    lcd.print(ProgramName);
    lcd.print(" ");
    lcd.print(Version);
    lcd.setCursor(0, 1);
    lcd.print("   is paused");
    delay(2000);
  }
}

//----------------------------------------
// Dump the DEBUG word to the serial port.
//     debug  the debug word to interpret into English
//----------------------------------------

void decode_debug_levels(int debug)
{
  if (debug & DEBUG_DDS)
    Serial.printf("    DEBUG_DDS\tbit is set: %06x\n", DEBUG_DDS);
  if (debug & DEBUG_FREQ)
    Serial.printf("    DEBUG_FREQ\tbit is set: %06x\n", DEBUG_FREQ);
  if (debug & DEBUG_MENU)
    Serial.printf("    DEBUG_MENU\tbit is set: %06x\n", DEBUG_MENU);
  if (debug & DEBUG_EVENT)
    Serial.printf("    DEBUG_EVENT\tbit is set: %06x\n", DEBUG_EVENT);
  if (debug & DEBUG_ACT)
    Serial.printf("    DEBUG_ACT\tbit is set: %06x\n", DEBUG_ACT);
  if (debug & DEBUG_RE)
    Serial.printf("    DEBUG_RE\tbit is set: %06x\n", DEBUG_RE);
  if (debug & DEBUG_INT)
    Serial.printf("    DEBUG_INT\tbit is set: %06x\n", DEBUG_INT);
  if (debug & DEBUG_DISP)
    Serial.printf("    DEBUG_DISP\tbit is set: %06x\n", DEBUG_DISP);
  if (debug & DEBUG_BATT)
    Serial.printf("    DEBUG_BATT\tbit is set: %06x\n", DEBUG_BATT);
  if (debug & DEBUG_MISC)
    Serial.printf("    DEBUG_MISC\tbit is set: %06x\n", DEBUG_MISC);
}

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

// Code for the device will contain internal variables that aren't saved.
//##############################################################################

bool Aborted = false;       // not aborted, yet

SelOffset VfoSelectDigit;   // selected column index, zero at the right

// the voltage measurement calibration
