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)
downloadrockbox-5dd17b1857b5de2a0250ef79898d2009583b6278.tar.gz
rockbox-5dd17b1857b5de2a0250ef79898d2009583b6278.zip
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 @@
51#include "playlist.h" 51#include "playlist.h"
52#include "buffer.h" 52#include "buffer.h"
53#include "rolo.h" 53#include "rolo.h"
54#include "screens.h"
55#include "power.h"
54 56
55char appsversion[]=APPSVERSION; 57char appsversion[]=APPSVERSION;
56 58
@@ -98,7 +100,8 @@ void init(void)
98{ 100{
99 int rc, i; 101 int rc, i;
100 struct partinfo* pinfo; 102 struct partinfo* pinfo;
101 bool coldstart; /* starting from Flash */ 103 /* if nobody initialized ATA before, I consider this a cold start */
104 bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */
102 105
103 system_init(); 106 system_init();
104 kernel_init(); 107 kernel_init();
@@ -133,8 +136,14 @@ void init(void)
133 136
134 button_init(); 137 button_init();
135 138
136 /* if nobody initialized ATA before, I consider this a cold start */ 139 if (coldstart && charger_inserted())
137 coldstart = (PACR2 & 0x4000) != 0; 140 {
141 rc = charging_screen(); /* display a "charging" screen */
142 if (rc == 1 || rc == 2) /* charger removed or "Off/Stop" pressed */
143 power_off();
144 /* "On" pressed or USB connected: proceed */
145 ide_power_enable(true);
146 }
138 147
139 rc = ata_init(); 148 rc = ata_init();
140 if(rc) 149 if(rc)
@@ -222,3 +231,4 @@ int main(void)
222 return 0; 231 return 0;
223} 232}
224#endif 233#endif
234