diff options
Diffstat (limited to 'apps/main.c')
-rw-r--r-- | apps/main.c | 16 |
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 | ||
55 | char appsversion[]=APPSVERSION; | 57 | char 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 | |||