summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2012-01-07 18:01:01 +0000
committerAmaury Pouly <pamaury@rockbox.org>2012-01-07 18:01:01 +0000
commit4200e979fa2d12445a0ba3b1c17f982fccb20909 (patch)
tree6611a7c4afc9252f46423e97a34ef1de9f6fa98b
parentfdf574adb4b99c04822cb03441d3f4fe4102eaa2 (diff)
downloadrockbox-4200e979fa2d12445a0ba3b1c17f982fccb20909.zip
rockbox-4200e979fa2d12445a0ba3b1c17f982fccb20909.tar.gz
rockbox-4200e979fa2d12445a0ba3b1c17f982fccb20909.tar.bz2
rockbox-4200e979fa2d12445a0ba3b1c17f982fccb20909.tar.xz
fuze+: workaround the power/volume+ multiplexing that would trigger a false power button detection on heavy usage (FS#12405). Thanks to Jean-Louis Biasini
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31599 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
index a723ce8..e349459 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
@@ -349,12 +349,26 @@ int button_read_device(void)
* events as well as recovery mode. Since the power button is the power button
* and the volume up button is recovery, it is not possible to know whether
* power button is down when volume up is down (except if there is another
- * method but volume up and power don't seem to be wired to GPIO pins). */
+ * method but volume up and power don't seem to be wired to GPIO pins).
+ * As a probable consequence of that, it has been reported that pressing
+ * volume up sometimes return BUTTON_POWER instead of BUTTON_VOL_UP. The
+ * following volume_power_lock prevent BUTTON_POWER to happen if volume up
+ * has been send since a very short time. */
+ static int volume_power_lock = 0;
+ if(volume_power_lock > 0)
+ volume_power_lock--;
switch(__XTRACT(HW_POWER_STS, PSWITCH))
{
- case 1: res |= BUTTON_POWER; break;
- case 3: res |= BUTTON_VOL_UP; break;
- default: break;
+ case 1:
+ if(volume_power_lock == 0)
+ res |= BUTTON_POWER;
+ break;
+ case 3:
+ res |= BUTTON_VOL_UP;
+ volume_power_lock = 5;
+ break;
+ default:
+ break;
}
return res | touchpad_read_device();
}