From fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 22 Jun 2004 10:52:39 +0000 Subject: Patch #881887 by Gerald Vanbaren. The red LED is now ON when recording and blinking when waiting to record (and when paused). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4790 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/led.c | 20 +++++++++++++++++++- firmware/export/led.h | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'firmware') diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c index adeb2714e0..f3b0693c6d 100644 --- a/firmware/drivers/led.c +++ b/firmware/drivers/led.c @@ -22,9 +22,13 @@ #include "led.h" #include "system.h" +static bool xor; +static bool current; + void led(bool on) { - if ( on ) + current = on; + if ( on ^ xor ) { or_b(0x40, &PBDRL); } @@ -33,3 +37,17 @@ void led(bool on) and_b(~0x40, &PBDRL); } } + +void invert_led(bool on) +{ + if ( on ) + { + xor = 1; + } + else + { + xor = 0; + } + led(current); +} + diff --git a/firmware/export/led.h b/firmware/export/led.h index 9b2552f738..cc035b9345 100644 --- a/firmware/export/led.h +++ b/firmware/export/led.h @@ -23,5 +23,6 @@ #include extern void led( bool on ); +extern void invert_led( bool on ); #endif -- cgit v1.2.3