 
 #define INPUT_BUFFER_UPDATE_TIMEOUT 10 // 10 ms
 
-template<class T> void lockedPrintln(const T& input)
-{
-  noInterrupts();
-  Serial.println(input);
-  interrupts();
-}
-
-template<class A, class B> void lockedPrintln(const A& a, const B& b)
-{
-  noInterrupts();
-  Serial.print(a);
-  Serial.println(b);
-  interrupts();
-}
+#define MICRO_CYCLES (F_CPU / 1000000)
+
+#define MAX_CMD_LEN 4096
+#define MAX_LOOP_LEN 10240
+
+static bool skippingInput = false;
+static String inputString;
 
 static char n64_raw_dump[36]; // maximum recv is 1+2+32 bytes + 1 bit
 // n64_raw_dump does not include the command byte. That gets pushed into

    bufferEndPos = writePos + readBytes;
    bufferHasData = true;
    interrupts();
}

static void startTimer()
{
  ARM_DWT_CYCCNT = 0;
}

static long readTimer()
{
  return ARM_DWT_CYCCNT;
}

/**

// bytes to send to the 64
// maximum we'll need to send is 33, 32 for a read request and 1 CRC byte
static unsigned char output_buffer[33];

// Simple switch buffer. (If buffer A fails to load while buffer B is in use,
// we still okay, and will try again next loop)
