FS#11769 - Change USB charge mode detection key
Opened by MichaelGiacomelli (saratoga) - Monday, 22 November 2010, 01:06 GMT
Last edited by MichaelGiacomelli (saratoga) - Monday, 16 May 2011, 20:31 GMT
Mostly for historical reasons, rockbox requires the user to hold down a key to enter charge mode when plugging in USB on a number of targets. Unfortunately, this has several problems on some targets, including:
1) The key is often quite different on different devices, even those with fairly similar layouts, so its often not obvious what to press.
For example, the gigabeat S and sansas all have a center select buttons, and a menu/home type button. On the S, the menu button enters charge mode. On the Sansas, select does it.
2) On some devices, its very difficult to hold the USB charge mode while inserting USB for mechanical reasons.
For example, on the Nano 2G or Sansa Clip, its extremely easy to hit another button while trying to force a USB plug in because the devices are both tiny and very sensitive.
To address the latter, the current code defines a USBPOWER_BTN_IGNORE, which is ignored if its also pressed. However for nearly all targets, the button is defined to something uesless, presumably because its purpose is not commented in the code.
This patch throws all that out. If you click any button while inserting USB, you will get charge mode. Asking on IRC, people seemed in favor of this approach. However, it is possible there are targets out there where this could make it difficult to enter USB mode due to awkward button placement. If so, this patch should be updated to work around that.
I'd appreciate feedback.
Monday, 16 May 2011, 20:31 GMT
Reason for closing: Accepted
Additional comments about closing: Accepted in r29889.