• Status New
  • Percent Complete
  • Task Type Patches
  • Category LCD
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by mcuelenaere - 2009-12-17

FS#10862 - Add second backlight timeout

This patch adds a secondary backlight timeout (similar to what the the iPod OF does).

It adds two extra settings: secondary backlight timeout and secondary brightness (I'm not sure wrt the naming of those, any suggestions?)

The code isn't very clean, but it works (except for CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM targets, for which I haven't implemented this).

Please test this.

What is this for? maybe you could explain a bit.

This adds a secondary configurable backlight timeout and brightness level, which allows for dimming the backlight after a couple of seconds and then completely shutting off after the "normal" backlight timeout (this behaviour is also present on some Nokia phones and the iPhone OF IIRC and is pretty useful IMO).

As an example to show this behaviour: set "normal" backlight to full brightness and 10sec timeout and secondary to halve brightness and 3 sec timeout.

This works on both my v1 Fuze and my v1 c240.

The only thing that I noticed that probably isn't supposed to be there is that there is 2 "Off" settings within the Secondary Backlight Timeout submenu - one at the very top of the list and one at the very bottom. Both of the off settings work though. This was on both of my DAPs.

Apart from that, I tested it with varying timeout settings and brightness levels for both of the normal settings and the secondary settings. It works very well.

I patched r24079 to test this.

teru commented on 2009-12-19 05:34

the patch doesn't compile for gigabeatfx.
I got following error:

/home/teru/rockbox/build/apps/settings.o: In function `settings_apply':
settings.c:(.text+0xfdc): undefined reference to `backlight_set_2nd_brightness'
/home/teru/rockbox/build/apps/settings_list.o:(.data+0x1c0): undefined reference to `backlight_set_2
collect2: ld returned 1 exit status

gigabeatfx also has similar but very limited feature and I implemented similar function before for only gigabeatfx by someone's request.
i hope this helps. (note: the patch is quite out dated)

As far as I can deduce, firmware/backlight-sw-fading.c is not the right place where define backlight_set_2nd_brightness().
I think it should be defined beside backlight_set_brightness().
If I have some time, I will try in this direction.
Cross the fingers. :-)

Did you hold your breath? ;-)

Probably the unresolved is due to the exclusion of backlight-sw-fading.c in build process, depending on the target type (Maurus states that he didn't implement it YET :-) for PWM fading targets).

I tried to take a look to the sources, but I have so little free time that I can't study the logic implemented.
I saw this statement in backlight.c

(void)fade_2nd; /* FIXME */

in function

static void backlight_setup_fade_down(bool fade_2nd)

Here it is called a backlight_dim(0) that I suppose switch the back light off.
I think that instead of a simply 0, it should be done something like in function_backlight_fade_down() in backlight-sw-fading.c, which takes care of argument fade_2nd.
But the question is: in PWM fading, how can I set the brightness to brightness_2nd?

Thanks for any hint.
I would like very much to see this feature in trunk.


Available keyboard shortcuts


Task Details

Task Editing