diff options
author | Thomas Jarosch <tomj@simonv.com> | 2014-12-20 13:57:54 +0100 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2014-12-20 14:03:23 +0100 |
commit | d62e1b3c5ff513fb69e784cbfb59dad1cc67899b (patch) | |
tree | 6934561b9eb9ddd1081205d970308936312e2fc9 | |
parent | ef1497c3dfca2dacdf6f96d97009fe388f726f4b (diff) |
vibe 500: Fix ide_powered() always returning false
While the right GPIO location is accessed,
the result of the logical AND was tested wrong.
I don't have this hardware, but I can imagine
that bug caused ide_power_enable() to be called
more times than it needed to be.
cppcheck reported:
[rockbox/firmware/target/arm/pbell/vibe500/power-vibe500.c:101]: (style) Expression '(X & 0x8) == 0x1' is always false.
Change-Id: I98498f79d383c6f29869e170bfc94ba9a0d2ba7e
-rw-r--r-- | firmware/target/arm/pbell/vibe500/power-vibe500.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/firmware/target/arm/pbell/vibe500/power-vibe500.c b/firmware/target/arm/pbell/vibe500/power-vibe500.c index e062ebddb7..6237f7eb8b 100644 --- a/firmware/target/arm/pbell/vibe500/power-vibe500.c +++ b/firmware/target/arm/pbell/vibe500/power-vibe500.c @@ -98,7 +98,7 @@ void ide_power_enable(bool on) bool ide_powered(void) { - return ((GPIOC_INPUT_VAL & 0x08) == 1); + return ((GPIOC_INPUT_VAL & 0x08) != 0); } void power_off(void) |