+ send_string("?" CRLF);
+}
+
+u16 sci_timer;
+void serial_rti() { /* called every 6.6 ms */
+ if (sci_timer) sci_timer--;
+}
+
+/* for gdb compatibility */
+int serial_readchar(u8 timeout) {
+ int ret;
+ sci_timer = timeout * 152;
+ while (sci_timer && sci_rx_buf_ptr_start == sci_rx_buf_ptr); /* spin */
+ if (sci_timer == 0) return SERIAL_TIMEOUT;
+ ret = sci_rx_buf[sci_rx_buf_ptr_start];
+ sci_rx_buf_ptr_start++;
+ sci_rx_buf_ptr_start %= BUFFER_LEN;
+ return ret;