1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 by Greg White
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
37 #include "backlight.h"
38 #include "backlight-target.h"
44 #include "rbunicode.h"
49 char version
[] = APPSVERSION
;
53 //Set backlight pin to output and enable
55 PCON0
= ((oldval
& ~(3 << 4)) | (1 << 4));
60 PCON1
= ((oldval
& ~(0xf << 16)) | (0 << 16));
62 //Set the piezo pins to output
64 PCON5
= ((oldval
& ~((0xf << 4) | (0xf << 8))) | ((1 << 0) | (1 << 4)));
65 PDAT5
&= ~((1 << 1) | (1 << 2)); //should not be needed
67 PDAT5
|= (1 << 1); //Toggle piezo +
69 //toggle backlight on PLAY
72 // Wait for play to be pressed
73 while(!(PDAT1
& (1 << 4)))
77 PDAT5
^= (1 << 1); //Toggle piezo +
78 PDAT0
^= (1 << 2); //Toggle packlight
80 // Wait for play to be released
81 while(PDAT1
& (1 << 4))