Rbutil now supports the Nano 2G.
[kugel-rb.git] / bootloader / pb_vibe500.c
blobd9259d43cc60f22cde5c37967d37f17bdd98f958
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2009 by Szymon Dziok
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
23 The bootloader does nothing and it's not needed (it was used to test different
24 stuff only), because the original bootloader stored in the flash has ability to
25 boot three different images in the SYSTEM directory:
26 jukebox.mi4 - when Power is pressed,
27 blupd.mi4 - when Power+C combo is used,
28 tester.mi4 - when Power+OK combo is used.
30 So we can use it to dual boot (for example renaming original jukebox.mi4 to
31 tester.mi4 and the rockbox.mi4 to jukebox.mi4).
35 #include <stdlib.h>
36 #include <stdio.h>
37 #include <stdarg.h>
38 #include <string.h>
40 #include "config.h"
42 #include "inttypes.h"
43 #include "cpu.h"
44 #include "system.h"
45 #include "lcd.h"
46 #include "kernel.h"
47 #include "thread.h"
48 #include "storage.h"
49 #include "fat.h"
50 #include "disk.h"
51 #include "font.h"
52 #include "backlight.h"
53 #include "backlight-target.h"
54 #include "button.h"
55 #include "panic.h"
56 #include "power.h"
57 #include "file.h"
58 #include "common.h"
59 #include "i2c.h"
61 /* #define UNK_01 (*(volatile unsigned long*)(0x7000a010)) */
63 char version[] = APPSVERSION;
65 extern int show_logo(void);
67 void main(void)
69 system_init();
70 kernel_init();
71 disable_irq();
72 lcd_init();
74 show_logo();
75 sleep(HZ*2);
77 while(1)
79 /* Power off bit */
80 if ((button_read_device()&BUTTON_POWER)!=0)
81 GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL,0x80);