More keypad fixes.
[uccvend-snackrom.git] / ROM2 / chime.c
diff --git a/ROM2/chime.c b/ROM2/chime.c
new file mode 100644 (file)
index 0000000..57c4630
--- /dev/null
@@ -0,0 +1,16 @@
+#include "vend.h"
+#include "chime.h"
+
+u8 chime_count;
+
+void chime() {
+       /* called from the RTI interrupt, sees if we need to turn the chime on or
+        * off (chime would be on for N RTI cycles
+        */
+       if (chime_count) {
+               bset((void*)&_io_ports[M6811_PORTA], PORTA_CHIME);
+               --chime_count;
+       } else
+               bclr((void*)&_io_ports[M6811_PORTA], PORTA_CHIME);
+}
+

UCC git Repository :: git.ucc.asn.au