diff options
author | Boris Gjenero <dreamlayers@rockbox.org> | 2009-04-14 19:23:39 +0000 |
---|---|---|
committer | Boris Gjenero <dreamlayers@rockbox.org> | 2009-04-14 19:23:39 +0000 |
commit | 0e74f75deba4029751050eefa6c4d13c1880b5d2 (patch) | |
tree | 55cc7fb01e027799cd41352d28f7c415b811fc48 /firmware/target/sh/archos/recorder/backlight-target.h | |
parent | 5b6af5e56019eec701f81450b79ca413fbae6032 (diff) | |
download | rockbox-0e74f75deba4029751050eefa6c4d13c1880b5d2.tar.gz rockbox-0e74f75deba4029751050eefa6c4d13c1880b5d2.zip |
FS#9635 - On V1, V2 and FM Archos recorders, ensure instant backlight switch-off. (Formerly, backlight switch-off was unpredicrable on some of these devices. The backlight would either turn off instantly or brighten instantly and then fade.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20707 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/sh/archos/recorder/backlight-target.h')
-rw-r--r-- | firmware/target/sh/archos/recorder/backlight-target.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/firmware/target/sh/archos/recorder/backlight-target.h b/firmware/target/sh/archos/recorder/backlight-target.h index f9da89b042..9eff09016a 100644 --- a/firmware/target/sh/archos/recorder/backlight-target.h +++ b/firmware/target/sh/archos/recorder/backlight-target.h @@ -28,14 +28,24 @@ static inline void _backlight_on(void) { - /* Enable square wave */ - rtc_write(0x0a, rtc_read(0x0a) | 0x40); + rtc_write(0x13, 0x10); /* 32 kHz square wave */ + rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */ } static inline void _backlight_off(void) { - /* Disable square wave */ - rtc_write(0x0a, rtc_read(0x0a) & ~0x40); + /* While on, backlight is flashing at 32 kHz. If the square wave output + is disabled while the backlight is lit, it will become constantly lit, + (brighter) and slowly fade. This resets the square wave counter and + results in the unlit state */ + unsigned char rtc_0a = rtc_read(0x0a) & ~0x40; + rtc_write(0x0a, rtc_0a); /* Disable square wave */ + rtc_write(0x13, 0xF0); /* 1 Hz square wave */ + rtc_write(0x0a, rtc_0a | 0x40); /* Enable square wave */ + + /* When the square wave output is disabled in the unlit state, + the backlight stays off */ + rtc_write(0x0a, rtc_0a); } #endif |