2002-05-16 12:53:40 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2002 by Bj<EFBFBD>rn Stenberg
|
|
|
|
|
*
|
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
|
*
|
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
|
* KIND, either express or implied.
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
2002-05-17 19:50:37 +00:00
|
|
|
|
#include "ata.h"
|
|
|
|
|
#include "disk.h"
|
|
|
|
|
#include "fat.h"
|
|
|
|
|
#include "lcd.h"
|
|
|
|
|
#include "debug.h"
|
|
|
|
|
#include "led.h"
|
|
|
|
|
#include "kernel.h"
|
|
|
|
|
#include "button.h"
|
2002-05-16 12:53:40 +00:00
|
|
|
|
#include "tree.h"
|
2002-05-21 14:28:10 +00:00
|
|
|
|
#include "panic.h"
|
|
|
|
|
#include "menu.h"
|
2002-05-29 09:14:38 +00:00
|
|
|
|
#include "system.h"
|
2002-05-27 06:56:35 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2002-05-24 15:40:14 +00:00
|
|
|
|
#include "dmalloc.h"
|
|
|
|
|
#include "bmalloc.h"
|
2002-05-27 06:56:35 +00:00
|
|
|
|
#endif
|
2002-05-24 15:40:14 +00:00
|
|
|
|
#include "mpeg.h"
|
2002-05-24 15:51:39 +00:00
|
|
|
|
#include "main_menu.h"
|
2002-05-16 12:53:40 +00:00
|
|
|
|
|
2002-05-29 10:05:27 +00:00
|
|
|
|
#include "version.h"
|
|
|
|
|
|
|
|
|
|
char appsversion[]=APPSVERSION;
|
|
|
|
|
|
2002-05-21 14:28:10 +00:00
|
|
|
|
void app_main(void)
|
|
|
|
|
{
|
|
|
|
|
browse_root();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef SIMULATOR
|
2002-05-24 15:40:14 +00:00
|
|
|
|
|
|
|
|
|
/* defined in linker script */
|
|
|
|
|
extern int poolstart[];
|
|
|
|
|
extern int poolend[];
|
|
|
|
|
|
2002-05-17 19:50:37 +00:00
|
|
|
|
int init(void)
|
|
|
|
|
{
|
2002-05-21 14:28:10 +00:00
|
|
|
|
int rc;
|
2002-05-24 15:40:14 +00:00
|
|
|
|
|
2002-05-29 09:14:38 +00:00
|
|
|
|
system_init();
|
|
|
|
|
|
2002-05-29 09:12:21 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
lcd_init();
|
|
|
|
|
#endif
|
|
|
|
|
show_splash();
|
2002-05-24 15:40:14 +00:00
|
|
|
|
dmalloc_initialize();
|
|
|
|
|
bmalloc_add_pool(poolstart, poolend-poolstart);
|
|
|
|
|
|
2002-05-27 09:53:28 +00:00
|
|
|
|
#ifdef DEBUG
|
2002-05-17 19:50:37 +00:00
|
|
|
|
debug_init();
|
2002-05-27 09:53:28 +00:00
|
|
|
|
#endif
|
2002-05-17 19:50:37 +00:00
|
|
|
|
kernel_init();
|
|
|
|
|
set_irq_level(0);
|
|
|
|
|
|
2002-05-21 14:28:10 +00:00
|
|
|
|
rc = ata_init();
|
|
|
|
|
if(rc)
|
|
|
|
|
panicf("ata: %d",rc);
|
2002-05-17 19:50:37 +00:00
|
|
|
|
|
2002-05-21 14:28:10 +00:00
|
|
|
|
rc = disk_init();
|
|
|
|
|
if (rc)
|
|
|
|
|
panicf("disk: %d",rc);
|
2002-05-17 19:50:37 +00:00
|
|
|
|
|
2002-05-21 14:28:10 +00:00
|
|
|
|
rc = fat_mount(part[0].start);
|
|
|
|
|
if(rc)
|
|
|
|
|
panicf("mount: %d",rc);
|
2002-05-17 19:50:37 +00:00
|
|
|
|
|
|
|
|
|
button_init();
|
2002-05-24 15:40:14 +00:00
|
|
|
|
mpeg_init();
|
2002-05-17 19:50:37 +00:00
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-16 12:53:40 +00:00
|
|
|
|
int main(void)
|
|
|
|
|
{
|
2002-05-17 19:50:37 +00:00
|
|
|
|
init();
|
2002-05-21 14:28:10 +00:00
|
|
|
|
app_main();
|
2002-05-17 19:50:37 +00:00
|
|
|
|
|
|
|
|
|
while(1) {
|
|
|
|
|
led(true); sleep(HZ/10);
|
|
|
|
|
led(false); sleep(HZ/10);
|
|
|
|
|
}
|
2002-05-16 12:53:40 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-05-21 14:28:10 +00:00
|
|
|
|
#endif
|