summaryrefslogtreecommitdiff
path: root/firmware/drivers/led.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-11-06 01:34:50 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-11-06 01:34:50 +0000
commit75bab49a542922bb3623f5671ec259e6ef4734d5 (patch)
treeeb0d8fedec577ec25460e951ccb1ce5d6f99fef0 /firmware/drivers/led.c
parent9e957579289cac6cb468500dff5bd169d97d45fa (diff)
set/clear port bits with atomic instructions instead of read-modify-write, saves time+space, allows port usage in ISR
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4022 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/led.c')
-rw-r--r--firmware/drivers/led.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/drivers/led.c b/firmware/drivers/led.c
index 293904f3f8..ad21dc9baf 100644
--- a/firmware/drivers/led.c
+++ b/firmware/drivers/led.c
@@ -20,6 +20,7 @@
#include <stdbool.h>
#include "sh7034.h"
#include "led.h"
+#include "system.h"
void led(bool on)
{
@@ -30,8 +31,12 @@ void led(bool on)
asm("and.b" "\t" "%0,@(r0,gbr)" : : "I"(~0x40), "z"(PBDR_ADDR+1));
#else
if ( on )
- PBDR |= 0x40;
+ {
+ __set_bit_constant(6, &PBDRL);
+ }
else
- PBDR &= ~0x40;
+ {
+ __clear_bit_constant(6, &PBDRL);
+ }
#endif
}