summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-09-02 20:19:58 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-09-02 20:19:58 +0000
commite278b4fddba62c5448e470146945480aaa358f64 (patch)
treea32aa9c0fb2378f663b297285ca2480b80c5f3e1
parentd88094daa4a7b33f1713a2715823cd845d12a298 (diff)
downloadrockbox-e278b4fddba62c5448e470146945480aaa358f64.tar.gz
rockbox-e278b4fddba62c5448e470146945480aaa358f64.tar.bz2
rockbox-e278b4fddba62c5448e470146945480aaa358f64.zip
Turn off automatically after a number of backlight toggles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18387 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/meizu_m6sl.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/bootloader/meizu_m6sl.c b/bootloader/meizu_m6sl.c
index 08e01fd333..3ee88120b5 100644
--- a/bootloader/meizu_m6sl.c
+++ b/bootloader/meizu_m6sl.c
@@ -50,6 +50,7 @@ char version[] = APPSVERSION;
void main(void)
{
+ int counter=0;
//Set backlight pin to output and enable
int oldval = PCON0;
PCON0 = ((oldval & ~(3 << 4)) | (1 << 4));
@@ -67,7 +68,7 @@ void main(void)
PDAT5 |= (1 << 1); //Toggle piezo +
//toggle backlight on PLAY
- while(true)
+ while(counter<20)
{
// Wait for play to be pressed
while(!(PDAT1 & (1 << 4)))
@@ -75,12 +76,21 @@ void main(void)
}
PDAT5 ^= (1 << 1); //Toggle piezo +
- PDAT0 ^= (1 << 2); //Toggle packlight
+ PDAT0 ^= (1 << 2); //Toggle backlight
+ counter++;
// Wait for play to be released
while(PDAT1 & (1 << 4))
{
}
}
+ //toggle a few times to warn that we're done
+ for(counter=0;counter<10;counter++)
+ {
+ volatile int i;
+ for(i=0;i<50000;i++);
+ PDAT0 ^= (1 << 2); //Toggle backlight
+ }
+ PDAT1&=~(1<<3);
}