summaryrefslogtreecommitdiffstats
path: root/bootloader/mrobe500.c
diff options
context:
space:
mode:
authorCatalin Patulea <cat@vv.carleton.ca>2007-11-02 06:13:43 +0000
committerCatalin Patulea <cat@vv.carleton.ca>2007-11-02 06:13:43 +0000
commitf57ea9acd751d955cc25f88724f25a5f28ccc083 (patch)
tree65c0167557fb684e6b29cbae3a198380305cfd51 /bootloader/mrobe500.c
parent38548c71185a3563b55f43b069fb7b5408691645 (diff)
downloadrockbox-f57ea9acd751d955cc25f88724f25a5f28ccc083.tar.gz
rockbox-f57ea9acd751d955cc25f88724f25a5f28ccc083.zip
m:robe 500i port: Add backlight support to the main build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15404 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/mrobe500.c')
-rwxr-xr-xbootloader/mrobe500.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/bootloader/mrobe500.c b/bootloader/mrobe500.c
index 34814ba8d5..3663612c74 100755
--- a/bootloader/mrobe500.c
+++ b/bootloader/mrobe500.c
@@ -98,8 +98,8 @@ void touchpad_calibrate_screen(void)
set_calibration_points(&tl, &br);
}
#endif
-static const uint8_t bl_low [] = {0xa4, 0x00, 0x55, 0xbb};
-static const uint8_t bl_high[] = {0xa4, 0x00, 0x19, 0xbb};
+static uint8_t bl_command[] = {0xa4, 0x00, 0x00, 0xbb};
+int brightness = 0;
void mrdebug(void)
{
@@ -130,10 +130,15 @@ void mrdebug(void)
address+=0x1000;
else if (button==BUTTON_RC_REW)
address-=0x1000;
- else if (button==BUTTON_RC_VOL_DOWN)
- spi_block_transfer(SPI_target_BACKLIGHT, bl_low, 4, 0, 0);
- else if (button==BUTTON_RC_VOL_UP)
- spi_block_transfer(SPI_target_BACKLIGHT, bl_high, 4, 0, 0);
+ else if (button==BUTTON_RC_VOL_DOWN) {
+ brightness = (brightness - 5) & 0x7f;
+ bl_command[2] = brightness;
+ spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
+ } else if (button==BUTTON_RC_VOL_UP) {
+ brightness = (brightness + 5) & 0x7f;
+ bl_command[2] = brightness;
+ spi_block_transfer(SPI_target_BACKLIGHT, bl_command, 4, 0, 0);
+ }
// {
// short x,y,z1,z2;
// tsc2100_read_values(&x, &y, &z1, &z2);