  * operational time.
  *
  * The MaxMs that actually control the light pattern for one group
- * of LED clusters (Blasters) are preloaded with their light
- * scripts. The MaxMs are connected over an I2C and have device ids
- * preset also. Note that the RTC has device id 0x68 whcih cannot
- * be changed.
+ * of LED clusters (Blasters) are preloaded with their light scripts.
+ * The MaxMs are connected over an I2C and have device ids preset
+ * also. Note that the RTC has device id 0x68 whcih cannot be changed.
  *
- * TODO finish description of operation
+ * There is an RTC plug on Jeenode port 1, the MaxMs are on the I2C 
+ * bus on port 2, and optionally there are 2 status LEDs on port 4
+ * being independently controlled with the DIO and AIO pins. LED1
+ * flashes once for the MAXM1 task, twice for the MAXM2 task to show
+ * the correct task ran; LED2 flashes once per minute to show the
+ * sketch is working.
  */
 
-#define DEBUG_FLASH
-/* #define DEBUG_TRACE */
+// Uncomment for LEDs flashing for debug
+#define DEBUG_FLASH 1
+// Uncomment for debug traces on the serial line
+#define DEBUG_TRACE 1 
 
 #include <JeeLib.h>
 #include <Wire.h> // needed to avoid a linker error :(

                // num_flash = (now.get() % 600);
                // num_flash = num_flash / 60;
            // }
            doFlash(led2, num_flash);
#endif

            // Check reschedule amount aganst RTC
            scheduler.timer(OPER_TIME, sec_til_loop * 10);

    return (hh * 60) + mm;
}

void doFlash(const Port ledPort, const byte ledNum, const byte cnt) {
#ifdef DEBUG_FLASH
    /* Serial.print("Flash LED "); */
    /* Serial.print(ledNum); */
    /* Serial.print(" "); */
    /* Serial.print(cnt); */
    /* Serial.println(" times"); */
    /* Serial.flush(); */

    byte cntr = cnt;
    while (cntr > 0) {
        cntr--;
        if (ledNum == 1) {
          ledPort.digiWrite(1);
          Sleepy::loseSomeTime(50);
          ledPort.digiWrite(0);
        } else {
          ledPort.digiWrite2(1);
          Sleepy::loseSomeTime(50);
          ledPort.digiWrite2(0);
        }

        if (cntr < 1) break;
        Sleepy::loseSomeTime(250);
    }
#endif
}

// RTC on port 1
PortI2C RTCbus (1);
