summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-07-17 20:29:51 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-07-17 20:29:51 +0000
commit5dd17b1857b5de2a0250ef79898d2009583b6278 (patch)
tree9797afe8303647d2a4ed862d06bd05ca43d04a7f /apps/main.c
parent782e2370e8022b0654edd6d1dbff67b10e6eeceb (diff)
A very basic charging screen, probably buggy, the pro's would make it much nicer, but it's a starting point.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3841 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/main.c b/apps/main.c
index 820c9c3088..c01e2d84e8 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -51,6 +51,8 @@
#include "playlist.h"
#include "buffer.h"
#include "rolo.h"
+#include "screens.h"
+#include "power.h"
char appsversion[]=APPSVERSION;
@@ -98,7 +100,8 @@ void init(void)
{
int rc, i;
struct partinfo* pinfo;
- bool coldstart; /* starting from Flash */
+ /* if nobody initialized ATA before, I consider this a cold start */
+ bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */
system_init();
kernel_init();
@@ -133,8 +136,14 @@ void init(void)
button_init();
- /* if nobody initialized ATA before, I consider this a cold start */
- coldstart = (PACR2 & 0x4000) != 0;
+ if (coldstart && charger_inserted())
+ {
+ rc = charging_screen(); /* display a "charging" screen */
+ if (rc == 1 || rc == 2) /* charger removed or "Off/Stop" pressed */
+ power_off();
+ /* "On" pressed or USB connected: proceed */
+ ide_power_enable(true);
+ }
rc = ata_init();
if(rc)
@@ -222,3 +231,4 @@ int main(void)
return 0;
}
#endif
+