diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-05-21 14:28:10 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-05-21 14:28:10 +0000 |
commit | 55c7da2c2c03e002a538c210ec4235e3efe8de44 (patch) | |
tree | adba1e4b1d30aac3c818871df0c369a97bafc372 /apps | |
parent | b21a3bd240d04fcba296021da6eb1276fde84a73 (diff) | |
download | rockbox-55c7da2c2c03e002a538c210ec4235e3efe8de44.tar.gz rockbox-55c7da2c2c03e002a538c210ec4235e3efe8de44.zip |
Added return code handling and integrated app_main()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@642 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/main.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/apps/main.c b/apps/main.c index 0492b0b778..44a218ac77 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -25,26 +25,34 @@ | |||
25 | #include "kernel.h" | 25 | #include "kernel.h" |
26 | #include "button.h" | 26 | #include "button.h" |
27 | #include "tree.h" | 27 | #include "tree.h" |
28 | #include "panic.h" | ||
29 | #include "menu.h" | ||
28 | 30 | ||
31 | void app_main(void) | ||
32 | { | ||
33 | show_splash(); | ||
34 | browse_root(); | ||
35 | } | ||
36 | |||
37 | #ifndef SIMULATOR | ||
29 | int init(void) | 38 | int init(void) |
30 | { | 39 | { |
40 | int rc; | ||
31 | debug_init(); | 41 | debug_init(); |
32 | kernel_init(); | 42 | kernel_init(); |
33 | set_irq_level(0); | 43 | set_irq_level(0); |
34 | 44 | ||
35 | if(ata_init()) { | 45 | rc = ata_init(); |
36 | DEBUGF("*** Warning! The disk is uninitialized\n"); | 46 | if(rc) |
37 | } | 47 | panicf("ata: %d",rc); |
38 | DEBUGF("ATA initialized\n"); | ||
39 | 48 | ||
40 | if (disk_init()) { | 49 | rc = disk_init(); |
41 | DEBUGF("*** Failed reading partitions\n"); | 50 | if (rc) |
42 | return -1; | 51 | panicf("disk: %d",rc); |
43 | } | ||
44 | 52 | ||
45 | if(fat_mount(part[0].start)) { | 53 | rc = fat_mount(part[0].start); |
46 | DEBUGF("*** Failed mounting fat\n"); | 54 | if(rc) |
47 | } | 55 | panicf("mount: %d",rc); |
48 | 56 | ||
49 | button_init(); | 57 | button_init(); |
50 | 58 | ||
@@ -54,8 +62,7 @@ int init(void) | |||
54 | int main(void) | 62 | int main(void) |
55 | { | 63 | { |
56 | init(); | 64 | init(); |
57 | 65 | app_main(); | |
58 | browse_root(); | ||
59 | 66 | ||
60 | while(1) { | 67 | while(1) { |
61 | led(true); sleep(HZ/10); | 68 | led(true); sleep(HZ/10); |
@@ -63,3 +70,4 @@ int main(void) | |||
63 | } | 70 | } |
64 | return 0; | 71 | return 0; |
65 | } | 72 | } |
73 | #endif | ||