* and snacks.
*/
-#define VERSION_STRING "V 20040624"
-
+#include "version.h"
#include "display_basic.h"
#include "keypad.h"
#include "chime.h"
send_string("102 Vend all motors starting." CRLF);
for (motor[0] = '0'; motor[0] <= '9'; motor[0]++) {
for (motor[1] = '0'; motor[1] <= '9'; motor[1]++) {
+ if (motor[1] == '5') continue; /* there is now row 5 */
send_string("101 Vending ");
send_string(motor);
send_string(CRLF);
- motor_reply(dispense_motor(motor[0]*10+motor[1]));
+ motor_reply(dispense_motor((motor[0]-'0')*10+(motor[1]-'0')));
}
}
send_string("102 Vend all motors complete." CRLF);
send_string(" key." CRLF);
}
+void send_timer() {
+ /* send a packet of the form KX with X being the key, or R for reset */
+ unsigned int t=get_timer_counter();
+
+ send_string("013 ");
+ sci_tx_buf[0] = '0'+(t/10000)%10;
+ sci_tx_buf[1] = '0'+(t/1000)%10;
+ sci_tx_buf[2] = '0'+(t/100)%10;
+ sci_tx_buf[3] = '0'+(t/10)%10;
+ sci_tx_buf[4] = '0'+t%10;
+ sci_tx_buf[5] = 0;
+ send_buffer(1);
+}
+
void send_door_msg(bool open) {
if (is_standalone()) return;
sci_tx_buf[0] = '4';
send_string("511 Unknown silence duration." CRLF);
return;
}
- send_string("500 Silence started." CRLF);
+ send_string("501 Silence started." CRLF);
return;
}
return;
}
send_string(
- "-----------------------------------------------------------------" CRLF
- "-----------------------------------------------------------------" CRLF
- " Revision " VERSION_STRING CRLF
- "" CRLF
+ CRLF
+ " Revision: " VERSION_STRING " Built: " DATEBUILT_STRING CRLF "" CRLF CRLF
" This snack machine was brought to you by " CRLF
" Bernard Blackham" CRLF
- " Mark Tearle" CRLF
" Harry McNally" CRLF
+ " Mark Tearle" CRLF
" Michal Gornisiewicz" CRLF
+ " Nick Bannon" CRLF
" and others." CRLF
"" CRLF
- " Another UCC project in action. http://www.ucc.asn.au/" CRLF
+ " Another UCC project in action. http://www.ucc.asn.au/" CRLF
);
}
);
}
+void identify() {
+ send_string(
+ "086 ROM " VERSION_STRING " " DATEBUILT_STRING CRLF
+ );
+}
+
void help() {
send_string(
"Valid commands are:" CRLF
" ECHO {ON|OFF} turn echo on or off" CRLF
" GETROM download the ROM source code using xmodem" CRLF
" H[...] this help screen" CRLF
- "*JUMPxxxx jumps to a subroute at location xxxx" CRLF
+ " IDENTIFY report ROM version" CRLF
+ "*JUMPxxxx jumps to a subroutine at location xxxx" CRLF
"*PEEKxxxx returns the value of the byte at location xxxx" CRLF
"*POKExxxxyy sets the value of location xxxx to yy" CRLF
" PING pongs" CRLF
"+Vnn vend an item" CRLF
"+VALL vend all items" CRLF
"*Wxxxxxxxxxxxx set a new password for authenticated vends. xxx=16 chars" CRLF
+ " password will be converted to uppercase" CRLF
"" CRLF
"Very few functions are available when the machine is in standalone " CRLF
"mode (DIP SW 1 is set)" CRLF
return;
}
char s[4];
+
+ u16 rom_addr;
+ rom_addr = (u16)(&_rom_src_data);
+
send_string("Writing to serial port (maybe). Size is 0x");
send_string(u82hex(_rom_src_len >> 8));
send_string(u82hex(_rom_src_len & 0xff));
send_string("@0x");
- send_string(u82hex((u16)(&_rom_src_data) >> 8));
- send_string(u82hex((u16)(&_rom_src_data) & 0xff));
+ send_string(u82hex(rom_addr >> 8));
+ send_string(u82hex(rom_addr & 0xff));
send_string(" with signature ");
s[0] = _rom_src_data[0];
s[1] = _rom_src_data[1];
s[2] = _rom_src_data[2];
s[3] = '\0';
send_string(s);
- send_string(CRLF " Type YES to download rom.tar.bz2 via XMODEM: ");
+ send_string(CRLF " Type YES to download rom.tar.lz via XMODEM: ");
msg_clr();
while (!sci_have_packet); /* spin */
if (!my_strncmp("YES", (char*)sci_rx_buf, 3)) {
send_string("5N4X0RZ R US" CRLF);
- mic_challenge = 0;
-
last_standalone = is_standalone();
if (last_standalone)
cur_motor[0] = 0xff;
}
if (sci_have_packet) {
+ send_string(CRLF);
switch (sci_rx_buf[0]) {
case '\0':
case '#':
case 'H':
help();
break;
+ case 'I':
+ identify();
+ break;
case 'M':
moo();
break;
}
} else
send_keypress(last_key);
+ send_timer();
}
/*