summaryrefslogtreecommitdiff
path: root/firmware/drivers/led.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-06-22 10:52:39 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-06-22 10:52:39 +0000
commitfafd2093e3ddaaabeb1a65e8a27e4a749f5edd15 (patch)
tree5c4e912fbc96588b485ea7eade04f4dd45ef1b1f /firmware/drivers/led.c
parent5c8a2f5835f0980f7d1646c6c9288235b7e3499b (diff)
downloadrockbox-fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15.zip
rockbox-fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15.tar.gz
rockbox-fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15.tar.bz2
rockbox-fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15.tar.xz
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
Diffstat (limited to 'firmware/drivers/led.c')
-rw-r--r--firmware/drivers/led.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c
index adeb271..f3b0693 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);
+}
+