diff options
author | Hristo Kovachev <bger@rockbox.org> | 2006-01-19 13:10:15 +0000 |
---|---|---|
committer | Hristo Kovachev <bger@rockbox.org> | 2006-01-19 13:10:15 +0000 |
commit | 4926682378ea22225675a4155a4fd3e5671f1a1c (patch) | |
tree | 0ef2efeecdcd16e1b483e0d518dd89de7059ba7e /firmware/backlight.c | |
parent | acf7d5e89e356cfe9e137e7e9eff74ddbbc9bc09 (diff) | |
download | rockbox-4926682378ea22225675a4155a4fd3e5671f1a1c.tar.gz rockbox-4926682378ea22225675a4155a4fd3e5671f1a1c.zip |
Patch #1404233 by Peter D'Hoye: H300 brightness bugfix
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8387 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r-- | firmware/backlight.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 25a91632cd..5e79e4e479 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -547,13 +547,29 @@ void remote_backlight_set_timeout(int index) {(void)index;} | |||
547 | #endif /* #ifdef CONFIG_BACKLIGHT */ | 547 | #endif /* #ifdef CONFIG_BACKLIGHT */ |
548 | 548 | ||
549 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS | 549 | #ifdef HAVE_BACKLIGHT_BRIGHTNESS |
550 | #ifdef IRIVER_H300_SERIES | ||
550 | void backlight_set_brightness(int val) | 551 | void backlight_set_brightness(int val) |
551 | { | 552 | { |
552 | /* set H300 brightness by changing the PWM | 553 | /* set H300 brightness by changing the PWM |
553 | accepts 0..15 but note that 0 and 1 gives a black display! */ | 554 | accepts 0..15 but note that 0 and 1 give a black display! */ |
554 | if(val < MIN_BRIGHTNESS_SETTING) | 555 | val &= 0x0F; |
555 | val = MIN_BRIGHTNESS_SETTING; | 556 | if(val<MIN_BRIGHTNESS_SETTING) |
556 | pcf50606_set_bl_pwm(val & 0xf); | 557 | val=MIN_BRIGHTNESS_SETTING; |
558 | |||
559 | /* shift one bit left */ | ||
560 | val <<= 1; | ||
561 | |||
562 | /* enable PWM */ | ||
563 | val |= 0x01; | ||
564 | |||
565 | /* disable IRQs while bitbanging */ | ||
566 | int old_irq_level = set_irq_level(HIGHEST_IRQ_LEVEL); | ||
567 | |||
568 | pcf50606_write(0x35, val); | ||
569 | |||
570 | /* enable IRQs again */ | ||
571 | set_irq_level(old_irq_level); | ||
557 | } | 572 | } |
558 | #endif | 573 | #endif |
574 | #endif | ||
559 | 575 | ||