From: jedin Date: Sat, 16 Aug 2003 07:53:52 +0000 (+0000) Subject: FIX: incorrect test for "no key pressed". X-Git-Tag: ROMW~53 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=31ce1b54368f8f1d2fcf05f6c767cbc8a269cae7;p=uccvend-snackrom.git FIX: incorrect test for "no key pressed". --- diff --git a/ROM2/keypad.c b/ROM2/keypad.c index 4105b24..23eddb8 100644 --- a/ROM2/keypad.c +++ b/ROM2/keypad.c @@ -10,6 +10,8 @@ bool new_key = 0; const u8 keymap0[8] = {KEY_8, KEY_7, KEY_6, KEY_5, KEY_4, KEY_3, KEY_2, KEY_1}; const u8 keymap1[3] = {KEY_RESET, KEY_0, KEY_9}; +#define NO_KEY 8 + extern inline u8 keypad_read_row(u8 row) { u8 i, num; if (row) @@ -34,7 +36,7 @@ void keypad_read() { /* FIXME: need to do debouncing of some sort? */ u8 key; key = keypad_read_row(0); - if (!key) { + if (NO_KEY == key) { key = keypad_read_row(1); key = keymap1[key]; } else