diff -ur rockbox-19370/firmware/drivers/rtc/rtc_m41st84w.c rockbox-19370-blfix/firmware/drivers/rtc/rtc_m41st84w.c --- rockbox-19370/firmware/drivers/rtc/rtc_m41st84w.c 2008-12-09 12:28:50.000000000 -0500 +++ rockbox-19370-blfix/firmware/drivers/rtc/rtc_m41st84w.c 2008-12-13 17:34:03.264300000 -0500 @@ -38,7 +38,9 @@ rtc_check_alarm_started(false); #endif +#if !defined(ARCHOS_FMRECORDER) && !defined(ARCHOS_RECORDERV2) rtc_write(0x13, 0x10); /* 32 kHz square wave */ +#endif /* Clear the Stop bit if it is set */ data = rtc_read(0x01); diff -ur rockbox-19370/firmware/target/sh/archos/fm_v2/backlight-target.h rockbox-19370-blfix/firmware/target/sh/archos/fm_v2/backlight-target.h --- rockbox-19370/firmware/target/sh/archos/fm_v2/backlight-target.h 2008-12-09 12:29:00.000000000 -0500 +++ rockbox-19370-blfix/firmware/target/sh/archos/fm_v2/backlight-target.h 2008-12-13 17:28:58.860300000 -0500 @@ -28,13 +28,22 @@ 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 */ + /* 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 */ + rtc_write(0x0a, rtc_read(0x0a) & ~0x40); /* Disable square wave */ + rtc_write(0x13, 0xF0); /* 1 Hz square wave */ + rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */ + + /* When the square wave output is disabled in the unlit state, + the backlight stays off */ rtc_write(0x0a, rtc_read(0x0a) & ~0x40); }