diff options
Diffstat (limited to 'bootloader/pb_vibe500.c')
-rw-r--r-- | bootloader/pb_vibe500.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/bootloader/pb_vibe500.c b/bootloader/pb_vibe500.c new file mode 100644 index 0000000000..70da0d32cc --- /dev/null +++ b/bootloader/pb_vibe500.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Szymon Dziok | ||
11 | * | ||
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. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | /* | ||
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. | ||
29 | |||
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). | ||
32 | */ | ||
33 | |||
34 | |||
35 | #include <stdlib.h> | ||
36 | #include <stdio.h> | ||
37 | #include <stdarg.h> | ||
38 | #include <string.h> | ||
39 | |||
40 | #include "config.h" | ||
41 | |||
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" | ||
60 | |||
61 | /* #define UNK_01 (*(volatile unsigned long*)(0x7000a010)) */ | ||
62 | |||
63 | char version[] = APPSVERSION; | ||
64 | |||
65 | extern int show_logo(void); | ||
66 | |||
67 | void main(void) | ||
68 | { | ||
69 | system_init(); | ||
70 | kernel_init(); | ||
71 | disable_irq(); | ||
72 | lcd_init(); | ||
73 | |||
74 | show_logo(); | ||
75 | sleep(HZ*2); | ||
76 | |||
77 | while(1) | ||
78 | { | ||
79 | /* Power off bit */ | ||
80 | if ((button_read_device()&BUTTON_POWER)!=0) | ||
81 | GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL,0x80); | ||
82 | } | ||
83 | } | ||