1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jörg Hohensohn 2003-11-06 01:34:50 +00:00
parent 9e95757928
commit 75bab49a54
8 changed files with 88 additions and 67 deletions

View file

@ -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();
}