 void reportDigitalCallback(byte port, int value)
 {
   if (port < TOTAL_PORTS) {
+    Serial.print("Report 0x"); Serial.print(value, HEX); Serial.print(" digital on "); Serial.println(port);
     reportPINs[port] = (byte)value;
   }
   // do not disable analog reporting on these 8 pins, to allow some

      }
      mask = mask << 1;
    }
    writePort(port, (byte)value, pinWriteMask);
  }
}

  /* Using non-looping code allows constants to be given to readPort().
   * The compiler will apply substantial optimizations if the inputs
   * to readPort() are compile-time constants. */
  for (uint8_t i=0; i<TOTAL_PORTS; i++) {
    if (reportPINs[i]) {
    //  Serial.print("Reporting on port"); Serial.println(i);
      uint8_t x = readPort(i, portConfigInputs[i]);
    //  Serial.print("Read 0x"); Serial.println(x, HEX);
      outputPort(i, x, false);
    }
  }
}

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