This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6417 - LCD Brightness for Nano
Attached to Project:
Rockbox
Opened by Billy (ipodfoo) - Wednesday, 06 December 2006, 19:58 GMT+2
Last edited by Dave Chapman (linuxstb) - Saturday, 17 November 2007, 23:53 GMT+2
Opened by Billy (ipodfoo) - Wednesday, 06 December 2006, 19:58 GMT+2
Last edited by Dave Chapman (linuxstb) - Saturday, 17 November 2007, 23:53 GMT+2
|
DetailsAnyone know where the lcd brightness patch is for the nano. I tried the one from http://www.rockbox.org/tracker/task/5234 but it doesnt show up in the menu on the nano. Senab used to have a patch for lcd brightness but I cant seem to find it anymore. Cheers for any pointers.
|
This task depends upon
Closed by Björn Stenberg (zagor)
Saturday, 17 November 2007, 23:53 GMT+2
Reason for closing: Fixed
Additional comments about closing: Closing all feature requests.
Saturday, 17 November 2007, 23:53 GMT+2
Reason for closing: Fixed
Additional comments about closing: Closing all feature requests.
#define HAVE_BACKLIGHT_BRIGHTNESS
/* LCD backlight brightness range and defaults */
#define MIN_BRIGHTNESS_SETTING 2 /* 2/16 (12.50%) */
#define MAX_BRIGHTNESS_SETTING 15 /* 15/16 (93.75%) */
#define DEFAULT_BRIGHTNESS_SETTING 9 /* 9/16 (56.25%) */
CC backlight.c
backlight.c: In function `backlight_set_brightness':
backlight.c:798: error: `bl_brightness' undeclared (first use in this function)
backlight.c:798: error: (Each undeclared identifier is reported only once
backlight.c:798: error: for each function it appears in.)
backlight.c:798: error: `bl_brightness_map' undeclared (first use in this funct
ion)
make[1]: *** [/home/user/rockbox-devel-181106/nano-sim/firmware/backlight.o] Er
ror 1
make: *** [all] Error 2
debian:/home/user/rockbox-devel-181106/nano-sim#
After that I have adapted the patch to the latest CVS.
I have update the patch in #5234 again to include the defines for the nano.
Please try to patch a clean CVS checkout with that and let us know if that works there.
#endif /* HAVE_REMOTE_LCD */
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
void backlight_set_brightness(int val)
{
if (val < MIN_BRIGHTNESS_SETTING)
val = MIN_BRIGHTNESS_SETTING;
else if (val > MAX_BRIGHTNESS_SETTING)
val = MAX_BRIGHTNESS_SETTING;
__backlight_set_brightness(val);
#endif
}
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
===========================================
And the patch needs to go:
#endif
}
#endif
+#if CONFIG_BACKLIGHT==BL_IPODNANO
+void backlight_set_brightness(int val)
+{
+ /* set ipod brightness by changing the PWM.
+ conveniently using the same range (2..15) as iriver,
+ so we have to map the range to 0..100% */
+ val &= 0x0F;
+ if(val<MIN_BRIGHTNESS_SETTING)
+ val=MIN_BRIGHTNESS_SETTING;
+ bl_brightness = bl_brightness_map[val];
+}
+#endif
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
Any ideas?
The #endif inside the function makes no sense (alone) and is probably a leftover from a previous try to patch which went wrong.
So get a clean CVS version again (the one from 18. Nov should also work with the latest brightness patch).
If backlight.c and the ipod config files are not modified by your other patches, you could try to only replace those with clean versions.
To see which (faulty) modifications your actual version of backlight.c contains, use cvs diff.
#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
#define HAVE_BACKLIGHT_BRIGHTNESS
in the config-ipodnano.h
Must uncomment it when compiling for a build. Bit annoying.