From: Bernard Blackham Date: Sun, 20 Jun 2004 15:30:36 +0000 (+0000) Subject: Cleanup and let gcc optimise the cases where row == 0 and row != 0 X-Git-Tag: ROMW~42 X-Git-Url: https://git.ucc.asn.au/?p=uccvend-snackrom.git;a=commitdiff_plain;h=b14807a016c121bc79efd5702ffba33c1dbd9be2;hp=ffaed3398a8ed1c381f0f3f316b4720caf025d22 Cleanup and let gcc optimise the cases where row == 0 and row != 0 --- diff --git a/ROM2/keypad.c b/ROM2/keypad.c index 6c04754..5bd5e2e 100644 --- a/ROM2/keypad.c +++ b/ROM2/keypad.c @@ -8,8 +8,6 @@ volatile bool new_key; /* first 8 from the first row, then 3 from the second row */ /* keys are 1-9, 0, reset */ -//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}; const u8 keymap0[8] = {KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8}; const u8 keymap1[3] = {KEY_9, KEY_0, KEY_RESET}; @@ -18,7 +16,7 @@ const u8 keymap1[3] = {KEY_9, KEY_0, KEY_RESET}; /* reads the keypad and returns the bit number that was turned on in the shift * register (from 0..7). If no bits were turned on, it returns 8 (aka NO_KEY) */ -extern inline u8 keypad_read_row(u8 row) { +extern inline u8 keypad_read_row(const u8 row) { u8 i, num; if (row)