Export some functions that might be useful
[uccvend-snackrom.git] / ROM2 / chime.h
index 7cc7fa7..e7543fc 100644 (file)
@@ -2,12 +2,19 @@
 #define _CHIME_H_
 
 #include "types.h"
+#include "vend.h"
 
-#define CHIME_TIME 10 /* number of RTI interrupts to have the chimer on */
+#define CHIME_TIME 5 /* number of RTIs to have the chime on (6.6ms each) */
 
 extern u8 chime_count;
 
-void chime();
+/* outside world interface */
 extern inline void chime_start() { chime_count = CHIME_TIME; }
 
+void chime(); /* RTI interrupt */
+
+/* internal helpers, also could be called from outside world */
+extern inline void chime_on() { bset((void*)&_io_ports[M6811_PORTA], PORTA_CHIME); }
+extern inline void chime_off() { bclr((void*)&_io_ports[M6811_PORTA], PORTA_CHIME);}
+
 #endif /* _CHIME_H_ */

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