
#include "serial.h"

#include "commands.h"

extern void initSerial() {
  Serial.begin(115200);
  byte seretry = 20;
  while ((!Serial) && (seretry>0)) {
    delay(500);
    seretry--;
  }
  Serial.setDebugOutput(true);
}

//
// --------- periodically called serial event handler ----------
//
extern void handleSerial() {
  if (Serial.available()>0) {
    char c = Serial.read();
    if (getEcho()) SERIAL_PRINT(c);
    handleInputChar(c);
  }
}
