From: Bernard Blackham Date: Fri, 15 Aug 2003 17:10:27 +0000 (+0000) Subject: Export some functions that might be useful X-Git-Tag: ROMW~57 X-Git-Url: https://git.ucc.asn.au/?p=uccvend-snackrom.git;a=commitdiff_plain;h=aa57581662d5b03db65a11ecaccfaa3df24a83b0 Export some functions that might be useful --- diff --git a/ROM2/chime.c b/ROM2/chime.c index 57c4630..e959c1a 100644 --- a/ROM2/chime.c +++ b/ROM2/chime.c @@ -5,12 +5,12 @@ 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 + * off (chime would be on for N RTI cycles) */ if (chime_count) { - bset((void*)&_io_ports[M6811_PORTA], PORTA_CHIME); + chime_on(); --chime_count; } else - bclr((void*)&_io_ports[M6811_PORTA], PORTA_CHIME); + chime_off(); } diff --git a/ROM2/chime.h b/ROM2/chime.h index 7cc7fa7..e7543fc 100644 --- a/ROM2/chime.h +++ b/ROM2/chime.h @@ -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_ */