From 7d8c5aaf6ac05eea2ea1fb3a3af938c68372264e Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 1 Sep 2006 22:03:14 +0000 Subject: 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 --- firmware/backlight.c | 2 +- firmware/timer.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'firmware') 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) if (bl_timer_active) return ; - if (timer_register(0, backlight_release_timer, 1, 0, backlight_isr)) + if (timer_register(0, backlight_release_timer, 2, 0, backlight_isr)) { #ifdef CPU_COLDFIRE /* 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) } if (pfn_timer != NULL) { - cycles_new = -1; + cycles_new = -1; /* "lock" the variable, in case timer_set_period() * is called within pfn_timer() */ pfn_timer(); @@ -151,7 +151,7 @@ static bool timer_set(long cycles, bool start) TCN1 = 0; /* reset the timer */ TER1 = 0xff; /* clear all events */ #elif CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 - if (cycles > 0x20000000) + if (cycles > 0x20000000 || cycles < 2) return false; if (start) -- cgit v1.2.3