From e278b4fddba62c5448e470146945480aaa358f64 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Tue, 2 Sep 2008 20:19:58 +0000 Subject: [PATCH] Turn off automatically after a number of backlight toggles. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18387 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/meizu_m6sl.c | 14 ++++++++++++-- 1 file 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); }