From 6c999a9b53de2c3106c7e8374f7133d6f72205b9 Mon Sep 17 00:00:00 2001 From: Tomas Salfischberger Date: Wed, 8 Jun 2005 15:55:19 +0000 Subject: More optimized fix (doing GPIO1_READ just once) Formatting as amiconn wanted :) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6615 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/button.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index afdbccbfad..0ebb368325 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c @@ -438,19 +438,12 @@ static int button_read(void) } /* special buttons */ - if (!button_hold()) - { - data = GPIO1_READ; - if ((data & 0x20) == 0) - btn |= BUTTON_ON; - } - - if (!remote_button_hold()) - { - data = GPIO1_READ; - if ((data & 0x40) == 0) - btn |= BUTTON_RC_ON; - } + data = GPIO1_READ; + if (!button_hold() && (data & 0x20 == 0)) + btn |= BUTTON_ON; + if (!remote_button_hold() && (data & 0x40 == 0)) + btn |= BUTTON_RC_ON; + #elif CONFIG_KEYPAD == RECORDER_PAD -- cgit v1.2.3