 
 //---------------------
 
+// Returns true if there is time to andle at least one message inbound our outbound.
+// Includes time required to encrypt/decrypt/print a message if need be (~0.5s at 1MHz CPU).
+static bool timeToHandleMessage()
+  {
+  const uint8_t sct = OTV0P2BASE::getSubCycleTime();
+  return(sct < min((OTV0P2BASE::GSCT_MAX/4)*3, nearOverrunThreshold - 1)); 
+  }
+
 // Controller's view of Least Significant Digits of the current (local) time, in this case whole seconds.
 #define TIME_CYCLE_S 60 // TIME_LSD ranges from 0 to TIME_CYCLE_S-1, also major cycle length.
 static uint_fast8_t TIME_LSD; // Controller's notion of seconds within major cycle.

  // Command-Line Interface (CLI) polling, if still active.
  if(isCLIActive())
    {
    const uint8_t sct = OTV0P2BASE::getSubCycleTime();
    const uint8_t listenTime = OTV0P2BASE::CLI::MIN_CLI_POLL_SCT;
    const uint8_t stopBy = nearOverrunThreshold - 1;
    pollCLI(stopBy, 0 == TIME_LSD);
    }

  // Detect and handle (actual or near) overrun, if it happens, though it should not.

  if((n >= CC1_A_PREFIX_LEN) && (0 == strncmp("+CC1 !", buf, CC1_A_PREFIX_LEN)))
    {
    // Send the alert!
    return(sendCC1Alert());
    }
#endif

