2 * main_basic.c - a simplified main procedure that relies upon a ersver to do
3 * anything smart. Just be a dumb interface to a display, keypad, coin mech
7 #include "display_basic.h"
15 extern inline void enable_rti() {
21 _io_ports[M6811_TMSK2] = 0x40;
22 /* powerup ADC, set IRQ' for edge-sensitive operation */
23 _io_ports[M6811_OPTION] = 0xA0;
24 /* set the stack pointer */
25 //asm volatile ("lds %1":: "i"(_stack):"sp");
30 goto loop_forever; /* wait for an interrupt to wake us up again */
34 u16 last_coin_value = coin_value;
42 case 'V': /* dispense something */
44 case 'D': /* write string to display */
48 case 'U': /* query current coin balance */
50 case 'G': /* give change */
59 if (keypad_pressed()) {
60 /* send packet about it */
64 if (coin_value != last_coin_value) {
65 /* send a packet about it */
71 chime(); /* turn chime on or off as need be */