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
;
54 //Set backlight pin to output and enable
56 PCON0
= ((oldval
& ~(3 << 4)) | (1 << 4));
61 PCON1
= ((oldval
& ~(0xf << 16)) | (0 << 16));
63 //Set the piezo pins to output
65 PCON5
= ((oldval
& ~((0xf << 4) | (0xf << 8))) | ((1 << 0) | (1 << 4)));
66 PDAT5
&= ~((1 << 1) | (1 << 2)); //should not be needed
68 PDAT5
|= (1 << 1); //Toggle piezo +
70 //toggle backlight on PLAY
73 // Wait for play to be pressed
74 while(!(PDAT1
& (1 << 4)))
78 PDAT5
^= (1 << 1); //Toggle piezo +
79 PDAT0
^= (1 << 2); //Toggle backlight
82 // Wait for play to be released
83 while(PDAT1
& (1 << 4))
87 //toggle a few times to warn that we're done
88 for(counter
=0;counter
<10;counter
++)
92 PDAT0
^= (1 << 2); //Toggle backlight