X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=ROM2%2Fcoinmech.c;h=124c8356ceea229f26bebc3cb52ca61b86c26ae4;hb=8209e6e9a79982684e617d386505952a338b15f2;hp=c52e146bcec46275a3e1f2260a8655a25d5bac33;hpb=41ad37ba6d86ccc4f8f720cb09f7891ae166cb38;p=uccvend-snackrom.git diff --git a/ROM2/coinmech.c b/ROM2/coinmech.c index c52e146..124c835 100644 --- a/ROM2/coinmech.c +++ b/ROM2/coinmech.c @@ -4,14 +4,14 @@ #define COINMECH_ID 0x20 volatile u8 last_byte; -volatile u8 packet_pos = 0; -volatile u16 value_1 = 0; -volatile u8 value_2 = 0; -volatile u8 dec_point = 0; +volatile u8 packet_pos; +volatile u16 value_1; +volatile u8 value_2; +volatile u8 dec_point; -volatile u16 coin_value = 0; -u8 item_cost = 0; -volatile bool have_change = 0; +volatile u16 coin_value; +u8 item_cost; +volatile bool have_change; u8 parity_test(u8 c) { u8 parity = 0; @@ -51,7 +51,7 @@ void send_byte(u8 c) { } #define IS_CTRL(x) (x & 0x10) /* true if this packet is a control packet */ -void sci_interrupt() { +void sci_interrupt_coinmech() { u8 in; in = _io_ports[M6811_SCDR]; @@ -132,6 +132,12 @@ void coin_cost(u16 cost) { } void coinmech_init() { + packet_pos = 0; + value_1 = value_2 = 0; + dec_point = 0; + coin_value = 0; + item_cost = 0; + have_change = 0; _io_ports[M6811_SCCR1] = 0x10; _io_ports[M6811_SCCR2] = 0x2e; _io_ports[M6811_BAUD] = 0x03;