forked from len0rd/rockbox
Added return code handling and integrated app_main()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@642 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b21a3bd240
commit
55c7da2c2c
1 changed files with 21 additions and 13 deletions
34
apps/main.c
34
apps/main.c
|
@ -25,26 +25,34 @@
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
#include "button.h"
|
#include "button.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
|
#include "panic.h"
|
||||||
|
#include "menu.h"
|
||||||
|
|
||||||
|
void app_main(void)
|
||||||
|
{
|
||||||
|
show_splash();
|
||||||
|
browse_root();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef SIMULATOR
|
||||||
int init(void)
|
int init(void)
|
||||||
{
|
{
|
||||||
|
int rc;
|
||||||
debug_init();
|
debug_init();
|
||||||
kernel_init();
|
kernel_init();
|
||||||
set_irq_level(0);
|
set_irq_level(0);
|
||||||
|
|
||||||
if(ata_init()) {
|
rc = ata_init();
|
||||||
DEBUGF("*** Warning! The disk is uninitialized\n");
|
if(rc)
|
||||||
}
|
panicf("ata: %d",rc);
|
||||||
DEBUGF("ATA initialized\n");
|
|
||||||
|
|
||||||
if (disk_init()) {
|
rc = disk_init();
|
||||||
DEBUGF("*** Failed reading partitions\n");
|
if (rc)
|
||||||
return -1;
|
panicf("disk: %d",rc);
|
||||||
}
|
|
||||||
|
|
||||||
if(fat_mount(part[0].start)) {
|
rc = fat_mount(part[0].start);
|
||||||
DEBUGF("*** Failed mounting fat\n");
|
if(rc)
|
||||||
}
|
panicf("mount: %d",rc);
|
||||||
|
|
||||||
button_init();
|
button_init();
|
||||||
|
|
||||||
|
@ -54,8 +62,7 @@ int init(void)
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
|
app_main();
|
||||||
browse_root();
|
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
led(true); sleep(HZ/10);
|
led(true); sleep(HZ/10);
|
||||||
|
@ -63,3 +70,4 @@ int main(void)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue