X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM2%2Fcomm.h;h=c203708ab5cd9d226cc52259f2c7bda86febda05;hb=0d180f72f93966ca6d4b326dfd6eff4681cdd6e8;hp=9bff8bdf45bb9dac90767eef78c19965daf3fc7e;hpb=293827a53b325c2faffddcba380b6f0c19da802a;p=uccvend-snackrom.git diff --git a/ROM2/comm.h b/ROM2/comm.h index 9bff8bd..c203708 100644 --- a/ROM2/comm.h +++ b/ROM2/comm.h @@ -10,8 +10,11 @@ * * Messages Sent: * KX - keypad press where X is (ascii 0..9 or R) - * CXXXXX - coin balance, XXXXX is number of cents. + * CYXXXXX - coin balance, XXXXX is number of cents. Y is 0 if we have change, + * 1 otherwise * MXYY - dispense ack/nack. X is what happened (0..MOTOR_*_FAIL), YY is the motor + * DX - door open/close event where X is 1 for open, 0 for closed. + * PONG - response to a ping * * Messages Received: * VXX - vend a slot XX @@ -20,10 +23,11 @@ * U - query current coin balance. - replies with CXXXXX * GXXXXX - give change, XXXXX is the amount of the cost of the item hence change * is the current value in the coin mech - XXXXX + * PING - ping. responds with PONG * */ -#define TX_BUFFER_LEN 6 /* maximum 12 due to the way tx_int works with the FIFO */ +#define TX_BUFFER_LEN 8 /* maximum 12 due to the way tx_int works with the FIFO */ extern char tx_buffer[TX_BUFFER_LEN+2]; /* \n + null terminated */ #define RX_BUFFER_LEN 11 extern volatile char rx_buffer[RX_BUFFER_LEN+1]; /* null terminated */