From 75bab49a542922bb3623f5671ec259e6ef4734d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hohensohn?= Date: Thu, 6 Nov 2003 01:34:50 +0000 Subject: 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 --- firmware/backlight.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'firmware/backlight.c') 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(); } -- cgit v1.2.3