diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-11-06 01:34:50 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2003-11-06 01:34:50 +0000 |
commit | 75bab49a542922bb3623f5671ec259e6ef4734d5 (patch) | |
tree | eb0d8fedec577ec25460e951ccb1ce5d6f99fef0 /firmware/backlight.c | |
parent | 9e957579289cac6cb468500dff5bd169d97d45fa (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/backlight.c')
-rw-r--r-- | firmware/backlight.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 5173d7819c..9a1159e59f 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -26,6 +26,7 @@ #include "rtc.h" #include "usb.h" #include "power.h" +#include "system.h" #define BACKLIGHT_ON 1 #define BACKLIGHT_OFF 2 @@ -73,7 +74,7 @@ void backlight_thread(void) /* Disable square wave */ rtc_write(0x0a, rtc_read(0x0a) & ~0x40); #else - PADR |= 0x4000; + __set_bit_constant(14-8, &PADRH); #endif } /* else if(backlight_timer) */ @@ -83,7 +84,7 @@ void backlight_thread(void) /* Enable square wave */ rtc_write(0x0a, rtc_read(0x0a) | 0x40); #else - PADR &= ~0x4000; + __clear_bit_constant(14-8, &PADRH); #endif } break; @@ -93,7 +94,7 @@ void backlight_thread(void) /* Disable square wave */ rtc_write(0x0a, rtc_read(0x0a) & ~0x40); #else - PADR |= 0x4000; + __set_bit_constant(14-8, &PADRH); #endif break; @@ -171,7 +172,7 @@ void backlight_init(void) create_thread(backlight_thread, backlight_stack, sizeof(backlight_stack), backlight_thread_name); - PAIOR |= 0x4000; + __set_bit_constant(14-8, &PAIORH); backlight_on(); } |