summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/SOURCES5
-rw-r--r--apps/main.c49
2 files changed, 5 insertions, 49 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index edb3bb3dd2..43cd3ddfb2 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -1,6 +1,3 @@
1#ifdef IRIVER_H100
2main.c
3#else
4alarm_menu.c 1alarm_menu.c
5bookmark.c 2bookmark.c
6credits.c 3credits.c
@@ -45,4 +42,4 @@ recorder/radio.c
45#ifdef HAVE_RECORDING 42#ifdef HAVE_RECORDING
46recorder/recording.c 43recorder/recording.c
47#endif 44#endif
48#endif 45
diff --git a/apps/main.c b/apps/main.c
index 8bcc25ae40..8154c44dcc 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -18,46 +18,6 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19#include "config.h" 19#include "config.h"
20 20
21#if defined(IRIVER_H100) && !defined(SIMULATOR)
22#include "thread.h"
23#include "cpu.h"
24
25unsigned long test_thread_stack[0x1000];
26
27void yield(void)
28{
29 switch_thread();
30 wake_up_thread();
31}
32
33void test_thread(void)
34{
35 while(1)
36 {
37 GPIO1_OUT ^= 0x00020000;
38 yield();
39 }
40}
41
42int main(void)
43{
44 int i;
45
46 init_threads();
47
48 create_thread(test_thread, test_thread_stack,
49 sizeof(test_thread_stack), "Test thread");
50
51 GPIO1_FUNCTION |= 0x00020000;
52 GPIO1_ENABLE |= 0x00020000;
53
54 while(1) {
55 for(i = 0;i < 10000;i++) {}
56 yield();
57 }
58}
59
60#else
61#include "ata.h" 21#include "ata.h"
62#include "disk.h" 22#include "disk.h"
63#include "fat.h" 23#include "fat.h"
@@ -157,9 +117,10 @@ void init(void)
157void init(void) 117void init(void)
158{ 118{
159 int rc; 119 int rc;
120#if defined(HAVE_CHARGING) && (CONFIG_CPU == SH7034)
160 /* if nobody initialized ATA before, I consider this a cold start */ 121 /* if nobody initialized ATA before, I consider this a cold start */
161 bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */ 122 bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */
162 123#endif
163 system_init(); 124 system_init();
164 kernel_init(); 125 kernel_init();
165 126
@@ -204,7 +165,7 @@ void init(void)
204 radio_init(); 165 radio_init();
205#endif 166#endif
206 167
207#ifdef HAVE_CHARGING 168#if defined(HAVE_CHARGING) && (CONFIG_CPU == SH7034)
208 if (coldstart && charger_inserted() 169 if (coldstart && charger_inserted()
209 && !global_settings.car_adapter_mode 170 && !global_settings.car_adapter_mode
210#ifdef ATA_POWER_PLAYERSTYLE 171#ifdef ATA_POWER_PLAYERSTYLE
@@ -218,8 +179,6 @@ void init(void)
218 /* "On" pressed or USB connected: proceed */ 179 /* "On" pressed or USB connected: proceed */
219 show_logo(); /* again, to provide better visual feedback */ 180 show_logo(); /* again, to provide better visual feedback */
220 } 181 }
221#else
222 (void)coldstart;
223#endif 182#endif
224 183
225 rc = ata_init(); 184 rc = ata_init();
@@ -311,4 +270,4 @@ int main(void)
311 return 0; 270 return 0;
312} 271}
313#endif 272#endif
314#endif 273