coin_cost(cost);
send_ack();
}
+
void send_keypress(u8 key) {
/* send a packet of the form KX with X being the key, or R for reset */
wait_for_tx_free();
if (key == KEY_RESET)
tx_buffer[1] = 'R';
else
- tx_buffer[1] = key+'0';
+ tx_buffer[1] = (key%10)+'0';
tx_buffer[2] = '\n';
tx_buffer[3] = 0;
send_packet();
u16 last_coin_value;
bool last_door_open;
- chime_start();
+ chime_on();
misc_output = 0;
changer_output = 0x7f;
_io_ports[M6811_PORTA] = 0xc8;
_io_ports[M6811_DDRD] = 0x3e;
_io_ports[M6811_SPCR] = 0x12;
+
+ delay(1000); chime_off(); /* mainly for debugging */
+
+ unlock(); /* enable interrupts */
display_init();
comm_init();
last_coin_value = 0;
last_door_open = 0;
+
while(1) {
if (door_open() != last_door_open) {
last_door_open = door_open();