8 #include <SoftwareSerial.h> 10 SoftwareSerial cmd_serial (CMD_RX_PIN, CMD_TX_PIN);
14 Serial.begin (DEBUG_SERIAL_BAUDRATE);
16 cmd_serial.begin (CMD_SERIAL_BAUDRATE);
21 bool serialCmdAvailable ()
23 return cmd_serial.available ();
28 while (!cmd_serial.available ());
31 void serialCmdWrite (uint8_t c)
36 void serialDebugWrite (uint8_t c)
41 uint8_t serialCmdRead ()
43 return cmd_serial.read ();
46 int serialCmdGetByte ()
52 if (i == CANCEL_SIGNAL)
54 serialDebugPrint (
"CANCEL_SIGNAL\n");
61 uint8_t serialDebugRead ()
63 return Serial.read ();
66 int serialDebugAvailable ()
68 return Serial.available ();
71 void serialDebugPrint (
const char* s)
79 void serialDebugPrintInt (
int i)
83 Serial.print (i, DEC);
87 void serialDebugPrintIntPretty (
const char* pre,
int i,
const char* post)
92 serialDebugPrintInt (i);
Whether to print debug output to the serial port.