summaryrefslogtreecommitdiff
path: root/firmware
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
parent5c8a2f5835f0980f7d1646c6c9288235b7e3499b (diff)
downloadrockbox-fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15.tar.gz
rockbox-fafd2093e3ddaaabeb1a65e8a27e4a749f5edd15.zip
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')
-rw-r--r--firmware/drivers/led.c20
-rw-r--r--firmware/export/led.h1
2 files changed, 20 insertions, 1 deletions
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 @@
22#include "led.h" 22#include "led.h"
23#include "system.h" 23#include "system.h"
24 24
25static bool xor;
26static bool current;
27
25void led(bool on) 28void led(bool on)
26{ 29{
27 if ( on ) 30 current = on;
31 if ( on ^ xor )
28 { 32 {
29 or_b(0x40, &PBDRL); 33 or_b(0x40, &PBDRL);
30 } 34 }
@@ -33,3 +37,17 @@ void led(bool on)
33 and_b(~0x40, &PBDRL); 37 and_b(~0x40, &PBDRL);
34 } 38 }
35} 39}
40
41void invert_led(bool on)
42{
43 if ( on )
44 {
45 xor = 1;
46 }
47 else
48 {
49 xor = 0;
50 }
51 led(current);
52}
53
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 @@
23#include <stdbool.h> 23#include <stdbool.h>
24 24
25extern void led( bool on ); 25extern void led( bool on );
26extern void invert_led( bool on );
26 27
27#endif 28#endif