From b14807a016c121bc79efd5702ffba33c1dbd9be2 Mon Sep 17 00:00:00 2001 From: Bernard Blackham Date: Sun, 20 Jun 2004 15:30:36 +0000 Subject: [PATCH] Cleanup and let gcc optimise the cases where row == 0 and row != 0 --- ROM2/keypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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) -- 2.20.1