diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2008-06-27 23:24:34 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2008-06-27 23:24:34 +0000 |
commit | 7b10ef9a7c55764d1b6815fd0871cb51ff0205f9 (patch) | |
tree | 0b2056ef0334e45107b02118040baae49d51b142 /bootloader/meizu_m6sl.c | |
parent | 5c763f4001c1634ea62ded26339df52494e6c718 (diff) | |
download | rockbox-7b10ef9a7c55764d1b6815fd0871cb51ff0205f9.tar.gz rockbox-7b10ef9a7c55764d1b6815fd0871cb51ff0205f9.zip |
initial Meizu M6SL port (take 2)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17819 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/meizu_m6sl.c')
-rw-r--r-- | bootloader/meizu_m6sl.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/bootloader/meizu_m6sl.c b/bootloader/meizu_m6sl.c new file mode 100644 index 0000000000..3bafd79e34 --- /dev/null +++ b/bootloader/meizu_m6sl.c | |||
@@ -0,0 +1,84 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Greg White | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "config.h" | ||
20 | |||
21 | #include <stdlib.h> | ||
22 | #include <stdio.h> | ||
23 | #include "inttypes.h" | ||
24 | #include "string.h" | ||
25 | #include "cpu.h" | ||
26 | #include "system.h" | ||
27 | #include "lcd.h" | ||
28 | #include "kernel.h" | ||
29 | #include "thread.h" | ||
30 | #include "ata.h" | ||
31 | #include "fat.h" | ||
32 | #include "disk.h" | ||
33 | #include "font.h" | ||
34 | #include "adc.h" | ||
35 | #include "backlight.h" | ||
36 | #include "backlight-target.h" | ||
37 | #include "button.h" | ||
38 | #include "panic.h" | ||
39 | #include "power.h" | ||
40 | #include "file.h" | ||
41 | #include "common.h" | ||
42 | #include "rbunicode.h" | ||
43 | #include "usb.h" | ||
44 | |||
45 | #include <stdarg.h> | ||
46 | |||
47 | char version[] = APPSVERSION; | ||
48 | |||
49 | void main(void) | ||
50 | { | ||
51 | //Set backlight pin to output and enable | ||
52 | int oldval = PCON0; | ||
53 | PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); | ||
54 | PDAT0 |= (1 << 2); | ||
55 | |||
56 | //Set PLAY to input | ||
57 | oldval = PCON1; | ||
58 | PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); | ||
59 | |||
60 | //Set the piezo pins to output | ||
61 | oldval = PCON5; | ||
62 | PCON5 = ((oldval & ~((0xf << 4) | (0xf << 8))) | ((1 << 0) | (1 << 4))); | ||
63 | PDAT5 &= ~((1 << 1) | (1 << 2)); //should not be needed | ||
64 | |||
65 | PDAT5 |= (1 << 1); //Toggle piezo + | ||
66 | |||
67 | //toggle backlight on PLAY | ||
68 | while(true) | ||
69 | { | ||
70 | // Wait for play to be pressed | ||
71 | while(!(PDAT1 & (1 << 4))) | ||
72 | { | ||
73 | } | ||
74 | |||
75 | PDAT5 ^= (1 << 1); //Toggle piezo + | ||
76 | PDAT0 ^= (1 << 2); //Toggle packlight | ||
77 | |||
78 | // Wait for play to be released | ||
79 | while(PDAT1 & (1 << 4)) | ||
80 | { | ||
81 | } | ||
82 | } | ||
83 | } | ||
84 | |||