summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-11 19:14:26 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-11 19:14:26 +0000
commit7c7dd43ccf404710fdafabefba1a7f7f76b8fd15 (patch)
treee8d82c436f94cb01741ea48652665d442cd84804
parentfbd4088df8807a220090dbf9e9a2c10771e2954a (diff)
downloadrockbox-7c7dd43ccf404710fdafabefba1a7f7f76b8fd15.zip
rockbox-7c7dd43ccf404710fdafabefba1a7f7f76b8fd15.tar.gz
rockbox-7c7dd43ccf404710fdafabefba1a7f7f76b8fd15.tar.bz2
rockbox-7c7dd43ccf404710fdafabefba1a7f7f76b8fd15.tar.xz
Fixed a long-standing bug in the charging screen. The charging screen froze when OFF was pressed. The intention was to powerdown, but this cannot work on archos, so the charging screen must not react on OFF. Made the charging screen react on the ON press instead of the release for better feedback. Bootbox uses SYS_POWEROFF for powering down.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7104 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/main.c2
-rw-r--r--apps/screens.c24
-rw-r--r--flash/bootbox/main.c27
3 files changed, 12 insertions, 41 deletions
diff --git a/apps/main.c b/apps/main.c
index 66e046a..4dee444 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -198,7 +198,7 @@ void init(void)
)
{
rc = charging_screen(); /* display a "charging" screen */
- if (rc == 1 || rc == 2) /* charger removed or "Off/Stop" pressed */
+ if (rc == 1) /* charger removed */
power_off();
/* "On" pressed or USB connected: proceed */
show_logo(); /* again, to provide better visual feedback */
diff --git a/apps/screens.c b/apps/screens.c
index 0ff88c6..badbdb7 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -339,11 +339,6 @@ int charging_screen(void)
{
unsigned int button;
int rc = 0;
-#ifdef BUTTON_OFF
- const unsigned int offbutton = BUTTON_OFF;
-#else
- const unsigned int offbutton = BUTTON_STOP;
-#endif
ide_power_enable(false); /* power down the disk, else would be spinning */
@@ -365,21 +360,12 @@ int charging_screen(void)
status_draw(false);
charging_display_info(true);
button = button_get_w_tmo(HZ/3);
-#ifdef BUTTON_ON
- if (button == (BUTTON_ON | BUTTON_REL))
-#else
- if (button == (BUTTON_RIGHT | BUTTON_REL))
-#endif
- rc = 3;
- else if (button == offbutton)
+ if (button == BUTTON_ON)
rc = 2;
- else
- {
- if (usb_detect())
- rc = 4;
- else if (!charger_inserted())
- rc = 1;
- }
+ else if (usb_detect())
+ rc = 3;
+ else if (!charger_inserted())
+ rc = 1;
} while (!rc);
#ifdef HAVE_LCD_CHARCELLS
diff --git a/flash/bootbox/main.c b/flash/bootbox/main.c
index 8c7c398..e5b4ac6 100644
--- a/flash/bootbox/main.c
+++ b/flash/bootbox/main.c
@@ -42,12 +42,6 @@
#include "usb.h"
#include "powermgmt.h"
-#ifdef BUTTON_OFF
- static const int offbutton = BUTTON_OFF;
-#else
- static const int offbutton = BUTTON_STOP;
-#endif
-
void usb_screen(void)
{
lcd_clear_display();
@@ -88,21 +82,12 @@ int charging_screen(void)
do
{
button = button_get_w_tmo(HZ/2);
-#ifdef BUTTON_ON
if (button == (BUTTON_ON | BUTTON_REL))
-#else
- if (button == (BUTTON_RIGHT | BUTTON_REL))
-#endif
- rc = 3;
- else if (button == offbutton)
rc = 2;
- else
- {
- if (usb_detect())
- rc = 4;
- else if (!charger_inserted())
- rc = 1;
- }
+ else if (usb_detect())
+ rc = 3;
+ else if (!charger_inserted())
+ rc = 1;
} while (!rc);
return rc;
@@ -133,7 +118,7 @@ void prompt_usb(const char* msg1, const char* msg2)
do
{
button = button_get(true);
- if (button == offbutton)
+ if (button == SYS_POWEROFF)
{
power_off();
}
@@ -166,7 +151,7 @@ void main(void)
)
{
rc = charging_screen(); /* display a "charging" screen */
- if (rc == 1 || rc == 2) /* charger removed or "Off/Stop" pressed */
+ if (rc == 1) /* charger removed */
power_off();
/* "On" pressed or USB connected: proceed */
show_logo(); /* again, to provide better visual feedback */