diff options
author | Tomas Salfischberger <tomas@rockbox.org> | 2005-06-08 15:55:19 +0000 |
---|---|---|
committer | Tomas Salfischberger <tomas@rockbox.org> | 2005-06-08 15:55:19 +0000 |
commit | 6c999a9b53de2c3106c7e8374f7133d6f72205b9 (patch) | |
tree | 79c9c4fe74b77fec5ee43ed10a60f76b423e5d7b /firmware/drivers | |
parent | 1e5ff8ad0a6b2eda4d1c8410d281cb9c149dc3b0 (diff) |
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
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/button.c | 19 |
1 files 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 |