+#include "display.h"
#include "vend.h"
+#define DELAY_MAGIC 20 /* FIXME: number of loops for ~ 1 millisecond (< 256) */
void delay(u16 ms) {
- /* FIXME fill me in */
+ u8 i;
+ for (;ms;ms--) {
+ for (i=0;i<DELAY_MAGIC; i++)
+ asm("nop\nnop\nnop\nnop\nnop\n");
+ }
}
-#define buffered_addr(a) \
- u8 a; \
- inline void set_##a(u8 b) { a = *_##a = b; } \
- inline void bset_##a(u8 m) { a |= m; *_##a = a; } \
- inline void bclr_##a(u8 m) { a &= ~m ; *_##a = a; }
-
-buffered_addr(switch_input)
-buffered_addr(misc_input)
-buffered_addr(home_sensors)
-buffered_addr(changer_output)
-buffered_addr(misc_output)
-
+void print_amount(u16 amt) {
+ /* take amt and show it on screen with a $ sign */
+ char str[10] = {' ', '$', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
+ u8 pos;
+ for (pos = 7; amt; pos--, amt/=10);
+ str[pos] = amt%10 + '0';
+ }
+ set_msg(str, WRAP_NONE);
+}