summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2008-06-27 23:24:34 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2008-06-27 23:24:34 +0000
commit7b10ef9a7c55764d1b6815fd0871cb51ff0205f9 (patch)
tree0b2056ef0334e45107b02118040baae49d51b142 /bootloader
parent5c763f4001c1634ea62ded26339df52494e6c718 (diff)
downloadrockbox-7b10ef9a7c55764d1b6815fd0871cb51ff0205f9.tar.gz
rockbox-7b10ef9a7c55764d1b6815fd0871cb51ff0205f9.tar.bz2
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')
-rw-r--r--bootloader/SOURCES2
-rw-r--r--bootloader/meizu_m6sl.c84
2 files changed, 86 insertions, 0 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES
index 37011dd700..19e40e2fc3 100644
--- a/bootloader/SOURCES
+++ b/bootloader/SOURCES
@@ -29,4 +29,6 @@ iriver_h300.c
mrobe500.c
#elif defined(CPU_TCC77X) || defined(CPU_TCC780X)
telechips.c
+#elif defined(MEIZU_M6SL)
+meizu_m6sl.c
#endif
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 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2006 by Greg White
+ *
+ * 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.
+ *
+ ****************************************************************************/
+#include "config.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "inttypes.h"
+#include "string.h"
+#include "cpu.h"
+#include "system.h"
+#include "lcd.h"
+#include "kernel.h"
+#include "thread.h"
+#include "ata.h"
+#include "fat.h"
+#include "disk.h"
+#include "font.h"
+#include "adc.h"
+#include "backlight.h"
+#include "backlight-target.h"
+#include "button.h"
+#include "panic.h"
+#include "power.h"
+#include "file.h"
+#include "common.h"
+#include "rbunicode.h"
+#include "usb.h"
+
+#include <stdarg.h>
+
+char version[] = APPSVERSION;
+
+void main(void)
+{
+ //Set backlight pin to output and enable
+ int oldval = PCON0;
+ PCON0 = ((oldval & ~(3 << 4)) | (1 << 4));
+ PDAT0 |= (1 << 2);
+
+ //Set PLAY to input
+ oldval = PCON1;
+ PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16));
+
+ //Set the piezo pins to output
+ oldval = PCON5;
+ PCON5 = ((oldval & ~((0xf << 4) | (0xf << 8))) | ((1 << 0) | (1 << 4)));
+ PDAT5 &= ~((1 << 1) | (1 << 2)); //should not be needed
+
+ PDAT5 |= (1 << 1); //Toggle piezo +
+
+ //toggle backlight on PLAY
+ while(true)
+ {
+ // Wait for play to be pressed
+ while(!(PDAT1 & (1 << 4)))
+ {
+ }
+
+ PDAT5 ^= (1 << 1); //Toggle piezo +
+ PDAT0 ^= (1 << 2); //Toggle packlight
+
+ // Wait for play to be released
+ while(PDAT1 & (1 << 4))
+ {
+ }
+ }
+}
+