diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-07-02 12:18:10 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-07-02 12:18:10 +0000 |
commit | a8cadd8181e53320109d2af61f0c7edea262d325 (patch) | |
tree | a266393b2b784fd5b9639c1a326a602b1ef34498 /firmware/drivers | |
parent | 8102f3da270ce5a442523a1738318493906bb86a (diff) | |
download | rockbox-a8cadd8181e53320109d2af61f0c7edea262d325.tar.gz rockbox-a8cadd8181e53320109d2af61f0c7edea262d325.zip |
Iriver: atomic I/O port manipulation macros, to avoid interference between normal and interrupt code. Todo: all other places that do port manipulation on ports which may also be changed from an intterupt should use that as well. It even decreases binary size a bit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6985 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/lcd-h100-remote.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index af6a45c2c0..eaf61260cb 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c | |||
@@ -50,14 +50,14 @@ | |||
50 | #define LCD_REMOTE_CNTL_HIGHCOL 0x10 /* Upper column address */ | 50 | #define LCD_REMOTE_CNTL_HIGHCOL 0x10 /* Upper column address */ |
51 | #define LCD_REMOTE_CNTL_LOWCOL 0x00 /* Lower column address */ | 51 | #define LCD_REMOTE_CNTL_LOWCOL 0x00 /* Lower column address */ |
52 | 52 | ||
53 | #define CS_LO GPIO1_OUT &= ~0x00000004 | 53 | #define CS_LO and_l(~0x00000004, &GPIO1_OUT) |
54 | #define CS_HI GPIO1_OUT |= 0x00000004 | 54 | #define CS_HI or_l(0x00000004, &GPIO1_OUT) |
55 | #define CLK_LO GPIO_OUT &= ~0x10000000 | 55 | #define CLK_LO and_l(~0x10000000, &GPIO_OUT) |
56 | #define CLK_HI GPIO_OUT |= 0x10000000 | 56 | #define CLK_HI or_l(0x10000000, &GPIO_OUT) |
57 | #define DATA_LO GPIO1_OUT &= ~0x00040000 | 57 | #define DATA_LO and_l(~0x00040000, &GPIO1_OUT) |
58 | #define DATA_HI GPIO1_OUT |= 0x00040000 | 58 | #define DATA_HI or_l(0x00040000, &GPIO1_OUT) |
59 | #define RS_LO GPIO_OUT &= ~0x00010000 | 59 | #define RS_LO and_l(~0x00010000, &GPIO_OUT) |
60 | #define RS_HI GPIO_OUT |= 0x00010000 | 60 | #define RS_HI or_l(0x00010000, &GPIO_OUT) |
61 | 61 | ||
62 | /* delay loop */ | 62 | /* delay loop */ |
63 | #define DELAY do { int _x; for(_x=0;_x<3;_x++);} while (0) | 63 | #define DELAY do { int _x; for(_x=0;_x<3;_x++);} while (0) |
@@ -115,12 +115,12 @@ static const char scroll_tick_table[16] = { | |||
115 | #ifndef SIMULATOR | 115 | #ifndef SIMULATOR |
116 | void lcd_remote_backlight_on(void) | 116 | void lcd_remote_backlight_on(void) |
117 | { | 117 | { |
118 | GPIO_OUT &= ~0x00000800; | 118 | and_l(~0x00000800, &GPIO_OUT); |
119 | } | 119 | } |
120 | 120 | ||
121 | void lcd_remote_backlight_off(void) | 121 | void lcd_remote_backlight_off(void) |
122 | { | 122 | { |
123 | GPIO_OUT |= 0x00000800; | 123 | or_l(0x00000800, &GPIO_OUT); |
124 | } | 124 | } |
125 | 125 | ||
126 | void lcd_remote_write_command(int cmd) | 126 | void lcd_remote_write_command(int cmd) |
@@ -363,14 +363,14 @@ static void remote_tick(void) | |||
363 | /* Initialise ports and kick off monitor */ | 363 | /* Initialise ports and kick off monitor */ |
364 | void lcd_remote_init(void) | 364 | void lcd_remote_init(void) |
365 | { | 365 | { |
366 | GPIO_FUNCTION |= 0x10010800; /* GPIO11: Backlight | 366 | or_l(0x10010800, &GPIO_FUNCTION); /* GPIO11: Backlight |
367 | GPIO16: RS | 367 | GPIO16: RS |
368 | GPIO28: CLK */ | 368 | GPIO28: CLK */ |
369 | 369 | ||
370 | GPIO1_FUNCTION |= 0x00040004; /* GPIO34: CS | 370 | or_l(0x00040004, &GPIO1_FUNCTION); /* GPIO34: CS |
371 | GPIO50: Data */ | 371 | GPIO50: Data */ |
372 | GPIO_ENABLE |= 0x10010800; | 372 | or_l(0x10010800, &GPIO_ENABLE); |
373 | GPIO1_ENABLE |= 0x00040004; | 373 | or_l(0x00040004, &GPIO1_ENABLE); |
374 | 374 | ||
375 | lcd_remote_clear_display(); | 375 | lcd_remote_clear_display(); |
376 | 376 | ||