+ if (sci_rx_buf_ptr >= BUFFER_LEN) {
+ sci_rx_buf[BUFFER_LEN] = '\0'; /* this is as much as we could fit */
+ sci_have_packet = 1;
+ sci_rx_buf_ptr = 0;
+ }
+}
+
+void sci_interrupt_serial() {
+ if (_io_ports[M6811_SCSR] & M6811_RDRF) sci_rx_int();
+
+ if (_io_ports[M6811_SCSR] & M6811_OR)
+ _io_ports[M6811_SCDR]; /* declare it a lost cause */