 	digitalWrite(RTS_PIN, HIGH);
 }
 
-// static unsigned long last_activity = 0;
+static unsigned long last_activity = 0;
 
 void loop() {
 	// static int written = 0;


// #define IGNORE_BBC_RX

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

#if defined(USE_INVERTED_SOFTWARE_SERIAL) || defined(USE_SOFTWARE_SERIAL)
#include <SoftwareSerial.h>
#endif

// Serial receive -- PD2, D0.
#define RXD_PIN 0

// Serial transmit -- PD3, D1.
#define TXD_PIN 1

#ifdef DEBUG_USB_LOOPBACK
			SerialUSB.write(c);
#endif
			last_activity = millis();
			// ++written;
		}

#ifndef IGNORE_BBC_RX
		while (SerialBBC.available()) {
			SerialUSB.write(SerialBBC.read());
			last_activity = millis();
		}
#endif

#ifdef DEBUG_REPORT_WHEN_QUIET
		if (millis() - last_activity > 1000) {
			SerialUSB.print("status: ");
			SerialUSB.print(digitalRead(CTS_PIN) == HIGH ? "cts high" : "cts low");
			SerialUSB.println();
			last_activity = millis();
		}
#endif
	}
}
