Message Integrity Checking
[uccvend-snackrom.git] / ROM2 / chime.h
1 #ifndef _CHIME_H_
2 #define _CHIME_H_
3
4 #include "types.h"
5 #include "vend.h"
6
7 #define CHIME_TIME 5 /* number of RTIs to have the chime on (6.6ms each) */
8
9 extern volatile u8 chime_count;
10 extern volatile u8 unchime_count;
11
12 /* outside world interface */
13 extern inline void chime_start() { chime_count = CHIME_TIME; }
14 extern inline void unchime_start() { unchime_count = CHIME_TIME; }
15 extern inline void chime_for(u8 time) { chime_count = time; }
16 extern inline void unchime_for(u8 time) { unchime_count = time; }
17
18 void chime(); /* RTI interrupt */
19
20 /* internal helpers, also could be called from outside world */
21 extern inline void chime_on() { bset((void*)&_io_ports[M6811_PORTA], PORTA_CHIME); }
22 extern inline void chime_off() { bclr((void*)&_io_ports[M6811_PORTA], PORTA_CHIME);}
23
24 #endif /* _CHIME_H_ */

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