summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBoris Gjenero <dreamlayers@rockbox.org>2009-04-14 19:23:39 +0000
committerBoris Gjenero <dreamlayers@rockbox.org>2009-04-14 19:23:39 +0000
commit0e74f75deba4029751050eefa6c4d13c1880b5d2 (patch)
tree55cc7fb01e027799cd41352d28f7c415b811fc48 /firmware
parent5b6af5e56019eec701f81450b79ca413fbae6032 (diff)
downloadrockbox-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')
-rw-r--r--firmware/drivers/rtc/rtc_m41st84w.c2
-rw-r--r--firmware/target/sh/archos/fm_v2/backlight-target.h18
-rw-r--r--firmware/target/sh/archos/recorder/backlight-target.h18
3 files changed, 28 insertions, 10 deletions
diff --git a/firmware/drivers/rtc/rtc_m41st84w.c b/firmware/drivers/rtc/rtc_m41st84w.c
index 25ea1b5ec5..738fb201bf 100644
--- a/firmware/drivers/rtc/rtc_m41st84w.c
+++ b/firmware/drivers/rtc/rtc_m41st84w.c
@@ -38,8 +38,6 @@ void rtc_init(void)
38 rtc_check_alarm_started(false); 38 rtc_check_alarm_started(false);
39#endif 39#endif
40 40
41 rtc_write(0x13, 0x10); /* 32 kHz square wave */
42
43 /* Clear the Stop bit if it is set */ 41 /* Clear the Stop bit if it is set */
44 data = rtc_read(0x01); 42 data = rtc_read(0x01);
45 if(data & 0x80) 43 if(data & 0x80)
diff --git a/firmware/target/sh/archos/fm_v2/backlight-target.h b/firmware/target/sh/archos/fm_v2/backlight-target.h
index f9da89b042..9eff09016a 100644
--- a/firmware/target/sh/archos/fm_v2/backlight-target.h
+++ b/firmware/target/sh/archos/fm_v2/backlight-target.h
@@ -28,14 +28,24 @@
28 28
29static inline void _backlight_on(void) 29static inline void _backlight_on(void)
30{ 30{
31 /* Enable square wave */ 31 rtc_write(0x13, 0x10); /* 32 kHz square wave */
32 rtc_write(0x0a, rtc_read(0x0a) | 0x40); 32 rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */
33} 33}
34 34
35static inline void _backlight_off(void) 35static inline void _backlight_off(void)
36{ 36{
37 /* Disable square wave */ 37 /* While on, backlight is flashing at 32 kHz. If the square wave output
38 rtc_write(0x0a, rtc_read(0x0a) & ~0x40); 38 is disabled while the backlight is lit, it will become constantly lit,
39 (brighter) and slowly fade. This resets the square wave counter and
40 results in the unlit state */
41 unsigned char rtc_0a = rtc_read(0x0a) & ~0x40;
42 rtc_write(0x0a, rtc_0a); /* Disable square wave */
43 rtc_write(0x13, 0xF0); /* 1 Hz square wave */
44 rtc_write(0x0a, rtc_0a | 0x40); /* Enable square wave */
45
46 /* When the square wave output is disabled in the unlit state,
47 the backlight stays off */
48 rtc_write(0x0a, rtc_0a);
39} 49}
40 50
41#endif 51#endif
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 @@
28 28
29static inline void _backlight_on(void) 29static inline void _backlight_on(void)
30{ 30{
31 /* Enable square wave */ 31 rtc_write(0x13, 0x10); /* 32 kHz square wave */
32 rtc_write(0x0a, rtc_read(0x0a) | 0x40); 32 rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */
33} 33}
34 34
35static inline void _backlight_off(void) 35static inline void _backlight_off(void)
36{ 36{
37 /* Disable square wave */ 37 /* While on, backlight is flashing at 32 kHz. If the square wave output
38 rtc_write(0x0a, rtc_read(0x0a) & ~0x40); 38 is disabled while the backlight is lit, it will become constantly lit,
39 (brighter) and slowly fade. This resets the square wave counter and
40 results in the unlit state */
41 unsigned char rtc_0a = rtc_read(0x0a) & ~0x40;
42 rtc_write(0x0a, rtc_0a); /* Disable square wave */
43 rtc_write(0x13, 0xF0); /* 1 Hz square wave */
44 rtc_write(0x0a, rtc_0a | 0x40); /* Enable square wave */
45
46 /* When the square wave output is disabled in the unlit state,
47 the backlight stays off */
48 rtc_write(0x0a, rtc_0a);
39} 49}
40 50
41#endif 51#endif