FS#10862 - Add second backlight timeout
Opened by Maurus Cuelenaere (mcuelenaere) - Thursday, 17 December 2009, 13:49 GMT
|
DetailsThis 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. |
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.
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.
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
nd_brightness'
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)
http://kamekun.web.fc2.com/rockbox/second_brightness.r20074.txt
I think it should be defined beside backlight_set_brightness().
If I have some time, I will try in this direction.
Cross the fingers. :-)
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.