RunMode readMode()
{
  return digitalRead(modePin) ? MODE_RX_MONITOR : MODE_GENERATOR;
}

bool afskTestEnabled()
{
  return !digitalRead(afskTestPin);
}

const char* modeName(RunMode mode)
{
  return (mode == MODE_RX_MONITOR) ? "RX" : "GEN";
}

bool generatorShouldStop()
{
  return (readMode() != MODE_GENERATOR) || afskTestEnabled();
}