From: Bernard Blackham Date: Mon, 21 Jun 2004 17:04:29 +0000 (+0000) Subject: More things to hopefully make this work. X-Git-Tag: ROMW~29 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c1fd53d73bce8779c822e3ed74de94f40714f9ca;p=uccvend-snackrom.git More things to hopefully make this work. --- diff --git a/ROM2/main_basic.c b/ROM2/main_basic.c index 50614b3..3e88648 100644 --- a/ROM2/main_basic.c +++ b/ROM2/main_basic.c @@ -163,6 +163,9 @@ int main() { unlock(); /* enable interrupts */ + delay(1000); + set_msg(" CRUEL "); + //comm_init(); //coinmech_init(); sci_init(); @@ -172,15 +175,14 @@ int main() { delay(1000); - set_msg(" CRUEL "); - - delay(1000); - set_msg(" WORLD "); delay(1000); chime_start(); + my_strncpy(sci_tx_buf, "5N4X0RZRUS\n", BUFFER_LEN); + send_packet(); + cur_motor[0] = 0xff; while(1) { if (cur_motor[0] == 0xff) { /* signal to say redraw screen */ diff --git a/ROM2/sci.c b/ROM2/sci.c index 4ce0d36..2346b28 100644 --- a/ROM2/sci.c +++ b/ROM2/sci.c @@ -1,4 +1,5 @@ #include "vend.h" +#include "chime.h" #include "sci.h" char sci_tx_buf[BUFFER_LEN]; @@ -32,6 +33,7 @@ void send_packet() { } void sci_rx_int() { + /* XXX FIXME we should do something about errors. nack? */ if (sci_have_packet) { /* overrun :( */ _io_ports[M6811_SCDR]; /* read it anyway */ @@ -52,7 +54,12 @@ void sci_rx_int() { } void sci_interrupt_serial() { + chime_start(); + 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 */ } void msg_clr() {