 /*
  * For Sparkfun SAMD21 boards, use SerialUSB device
  */
+
 #define mySerial SerialUSB
-#define PRINT(...) mySerial.print(__VA_ARGS__)
-#define PRINTLN(...) mySerial.println(__VA_ARGS__)
-
+#if 0
+#define PRINTS(...) mySerial.print(__VA_ARGS__)
+#define PRINTN(...) mySerial.print(__VA_ARGS__)
+#else
+#define PRINTS(...) print_s(__VA_ARGS__)
+#define PRINTN(...) print_n2(__VA_ARGS__)
+#endif
+
+static char buffer[80];
+static char *bufp;
 
 /*
  * Standard Arduio setup() function.

}

void loop() {
  for (int pin = 0; pin < PINS_COUNT; pin++) {  // For all defined pins
    if (print_pinno(pin)) {  // Does pin exist?

      int bitno = g_APinDescription[pin].ulPin;
      PortGroup *port = digitalPinToPort(pin);
      int pmuxval;

      print_portname(pin);

      if (port->PINCFG[bitno].bit.PMUXEN) {  // Is pinmux enabled?
        // If pinmux is enabled, further report it's value
        if (bitno & 1) {
          // Odd pin numbers
          pmuxval = port->PMUX[bitno / 2].bit.PMUXO;
        } else {
          pmuxval = port->PMUX[bitno / 2].bit.PMUXE;
        }
	print_pinmux(pin, pmuxval);
      } else {
        // Pinmux not enabled - port is GPIO
        PRINT("GPIO ");
        if (port->DIR.reg & (1 << bitno)) { // Decode pinmode (direction.)
          PRINT("O");
        } else {
          PRINT("I");
        }
      } // Pinmux or GPIO
    } // Pin existance
    PRINTLN();
  } // "pin" for loop

  while (mySerial.read() < 0)
    ;  // wait for character to run again.
  PRINTLN("\nRunning again!\n");
}



 * can apply to one of six different SERCOM modules on a SAMD21, and an ANALOG
 * PMUX value could be ADC, REF, DAC, or TouchController.)
 */
static void (*PMUX_decode_func[8])(int, int) = {
  decode_EIC,
  decode_ADC,
  decode_SERCOM,
