From d62e1b3c5ff513fb69e784cbfb59dad1cc67899b Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Sat, 20 Dec 2014 13:57:54 +0100 Subject: 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 --- firmware/target/arm/pbell/vibe500/power-vibe500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware') 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) -- cgit v1.2.3