From: jedin Date: Fri, 22 Aug 2003 11:25:17 +0000 (+0000) Subject: FIX: off by one error, when checking key bits X-Git-Tag: ROMW~46 X-Git-Url: https://git.ucc.asn.au/?p=uccvend-snackrom.git;a=commitdiff_plain;h=3e4543697766d4777790a051de20f729c7cf8341;ds=sidebyside FIX: off by one error, when checking key bits Corrected comment. --- diff --git a/ROM2/keypad.c b/ROM2/keypad.c index 980b234..0e03095 100644 --- a/ROM2/keypad.c +++ b/ROM2/keypad.c @@ -28,13 +28,13 @@ extern inline u8 keypad_read_row(u8 row) { while(!(_io_ports[M6811_SPDR]&M6811_SPIE)); /* wait for completion */ for (i = _io_ports[M6811_SPDR], num = 0; - ((i&0x1) == 0) && (num < 7); + ((i&0x1) == 0) && (num < 8); i=i>>1, num++); return num; } -/* returns a key 1..10 or 11 for reset */ +/* sets last_key to 1..10 or 11 for reset */ void keypad_read() { /* FIXME: need to do debouncing of some sort? */ u8 key;