 
 // #define IGNORE_BBC_RX
 
+// Define DEBUG_REPORT_WHEN_QUIET to output a report on the state of the
+// system every second when nothing else is happening:
+
+// #define DEBUG_REPORT_WHEN_QUIET
+
 // ----------------------------------------------------------------------
 
 #if defined(USE_INVERTED_SOFTWARE_SERIAL) || defined(USE_SOFTWARE_SERIAL)
 #include <SoftwareSerial.h>
 #endif
 
-// Serial receive -- PD2, D0.
-#define RXD_PIN 0
+// Serial receive -- usually PD2, D0, but we need one with a pin change
+// interrupt, so we use pin 8 (PB4/PCINT4/ADC11)
+#define RXD_PIN 8
 
 // 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

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

	digitalWrite(RTS_PIN, HIGH);
}

static unsigned long last_activity = 0;

void loop() {
	// static int written = 0;
