summaryrefslogtreecommitdiff
path: root/apps/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/main.c')
-rw-r--r--apps/main.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/apps/main.c b/apps/main.c
index 042d3a81f3..b98dfadad6 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -55,6 +55,9 @@
55#include "screens.h" 55#include "screens.h"
56#include "power.h" 56#include "power.h"
57#include "talk.h" 57#include "talk.h"
58#include "plugin.h"
59
60/*#define AUTOROCK*/ /* define this to check for "autostart.rock" on boot */
58 61
59char appsversion[]=APPSVERSION; 62char appsversion[]=APPSVERSION;
60 63
@@ -76,7 +79,8 @@ void init(void)
76 font_init(); 79 font_init();
77 show_logo(); 80 show_logo();
78 settings_reset(); 81 settings_reset();
79 settings_load(); 82 settings_load(SETTINGS_ALL);
83 settings_apply();
80 sleep(HZ/2); 84 sleep(HZ/2);
81 tree_init(); 85 tree_init();
82 playlist_init(); 86 playlist_init();
@@ -129,6 +133,7 @@ void init(void)
129 133
130#ifdef HAVE_RTC 134#ifdef HAVE_RTC
131 rtc_init(); 135 rtc_init();
136 settings_load(SETTINGS_RTC); /* early load parts of global_settings */
132#endif 137#endif
133 138
134 adc_init(); 139 adc_init();
@@ -142,7 +147,7 @@ void init(void)
142 powermgmt_init(); 147 powermgmt_init();
143 148
144#ifdef HAVE_BATTERIES 149#ifdef HAVE_BATTERIES
145 if (coldstart && charger_inserted()) 150 if (coldstart && charger_inserted() && !global_settings.car_adapter_mode)
146 { 151 {
147 rc = charging_screen(); /* display a "charging" screen */ 152 rc = charging_screen(); /* display a "charging" screen */
148 if (rc == 1 || rc == 2) /* charger removed or "Off/Stop" pressed */ 153 if (rc == 1 || rc == 2) /* charger removed or "Off/Stop" pressed */
@@ -196,7 +201,8 @@ void init(void)
196 } 201 }
197 } 202 }
198 203
199 settings_load(); 204 settings_load(SETTINGS_ALL);
205 settings_apply();
200 206
201 status_init(); 207 status_init();
202 playlist_init(); 208 playlist_init();
@@ -215,24 +221,20 @@ void init(void)
215 mpeg_init(); 221 mpeg_init();
216 talk_init(); 222 talk_init();
217 223
218 /* no auto-rolo on startup any more, but I leave it here for reference */ 224#ifdef AUTOROCK
219#if 0 225 if (!usb_detect())
220 if (coldstart && !usb_detect()) 226 {
221 { /* when starting from flash, this time _we_ have to yield */
222 int fd; 227 int fd;
223#ifdef ARCHOS_PLAYER 228 static const char filename[] = PLUGIN_DIR "/autostart.rock";
224 static const char filename[] = "/archos.mod"; 229
225#else
226 static const char filename[] = "/ajbrec.ajz";
227#endif
228 fd = open(filename, O_RDONLY); 230 fd = open(filename, O_RDONLY);
229 if(fd >= 0) /* no complaint if it doesn't exit */ 231 if(fd >= 0) /* no complaint if it doesn't exit */
230 { 232 {
231 close(fd); 233 close(fd);
232 rolo_load((char*)filename); /* start if it does */ 234 plugin_load((char*)filename, NULL); /* start if it does */
233 } 235 }
234 } 236 }
235#endif // #if 0 237#endif /* #ifdef AUTOROCK */
236} 238}
237 239
238int main(void) 240int main(void)