diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-09-01 22:03:14 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-09-01 22:03:14 +0000 |
commit | 7d8c5aaf6ac05eea2ea1fb3a3af938c68372264e (patch) | |
tree | cb4ee87bb9ffc21b087136ef983fde3c1b26c7c1 | |
parent | e7a9ec4d13078497e00ccb370abad63fc9d12be9 (diff) | |
download | rockbox-7d8c5aaf6ac05eea2ea1fb3a3af938c68372264e.tar.gz rockbox-7d8c5aaf6ac05eea2ea1fb3a3af938c68372264e.zip |
Make backlight fading work again on PP targets. The PP timer cannot handle a (real) cycle count of 1, the minimum is 2. This is now checked in timer_register() and timer_set_period().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10849 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/backlight.c | 2 | ||||
-rw-r--r-- | firmware/timer.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index b3fa5afb6a..6f7432c9e2 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -303,7 +303,7 @@ static void backlight_dim(int value) | |||
303 | if (bl_timer_active) | 303 | if (bl_timer_active) |
304 | return ; | 304 | return ; |
305 | 305 | ||
306 | if (timer_register(0, backlight_release_timer, 1, 0, backlight_isr)) | 306 | if (timer_register(0, backlight_release_timer, 2, 0, backlight_isr)) |
307 | { | 307 | { |
308 | #ifdef CPU_COLDFIRE | 308 | #ifdef CPU_COLDFIRE |
309 | /* Prevent cpu frequency changes while dimming. */ | 309 | /* Prevent cpu frequency changes while dimming. */ |
diff --git a/firmware/timer.c b/firmware/timer.c index 8523805890..84d0359008 100644 --- a/firmware/timer.c +++ b/firmware/timer.c | |||
@@ -60,7 +60,7 @@ void TIMER2(void) | |||
60 | } | 60 | } |
61 | if (pfn_timer != NULL) | 61 | if (pfn_timer != NULL) |
62 | { | 62 | { |
63 | cycles_new = -1; | 63 | cycles_new = -1; |
64 | /* "lock" the variable, in case timer_set_period() | 64 | /* "lock" the variable, in case timer_set_period() |
65 | * is called within pfn_timer() */ | 65 | * is called within pfn_timer() */ |
66 | pfn_timer(); | 66 | pfn_timer(); |
@@ -151,7 +151,7 @@ static bool timer_set(long cycles, bool start) | |||
151 | TCN1 = 0; /* reset the timer */ | 151 | TCN1 = 0; /* reset the timer */ |
152 | TER1 = 0xff; /* clear all events */ | 152 | TER1 = 0xff; /* clear all events */ |
153 | #elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 | 153 | #elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 |
154 | if (cycles > 0x20000000) | 154 | if (cycles > 0x20000000 || cycles < 2) |
155 | return false; | 155 | return false; |
156 | 156 | ||
157 | if (start) | 157 | if (start) |