diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2009-08-08 09:24:42 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2009-08-08 09:24:42 +0000 |
commit | c8e39403f414814d07129f9c7dc0f0c04edbf45f (patch) | |
tree | 5f6cb9f94afbcd558cf7cf367a8949b31f745a2d | |
parent | 236a0582c314951c9db38d644ff0c4057e34cfcc (diff) |
Samsung yp-s3: clean up the lcd and button driver (making things static, rename variables etc.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22203 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/s5l8700/yps3/button-yps3.c | 22 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/yps3/lcd-yps3.c | 8 |
2 files changed, 16 insertions, 14 deletions
diff --git a/firmware/target/arm/s5l8700/yps3/button-yps3.c b/firmware/target/arm/s5l8700/yps3/button-yps3.c index afcf89666b..bde322633c 100644 --- a/firmware/target/arm/s5l8700/yps3/button-yps3.c +++ b/firmware/target/arm/s5l8700/yps3/button-yps3.c @@ -24,6 +24,7 @@ #include "inttypes.h" #include "s5l8700.h" +#include "button.h" #include "button-target.h" /* Button driver for the touch keys on the Samsung YP-S3 @@ -63,7 +64,8 @@ void button_init_device(void) PCON4 &= ~0x0000F000; } -static unsigned int tkey_read(void) +/* returns the raw 20-bit word from the touch key controller */ +static int tkey_read(void) { static int value = 0; int i; @@ -103,7 +105,7 @@ static unsigned int tkey_read(void) int button_read_device(void) { int buttons = 0; - static unsigned int data; + int tkey_data; /* hold switch */ if (button_hold()) { @@ -116,26 +118,26 @@ int button_read_device(void) } /* touch keys */ - data = tkey_read(); - if (data & (1 << 9)) { + tkey_data = tkey_read(); + if (tkey_data & (1 << 9)) { buttons |= BUTTON_BACK; } - if (data & (1 << 8)) { + if (tkey_data & (1 << 8)) { buttons |= BUTTON_UP; } - if (data & (1 << 7)) { + if (tkey_data & (1 << 7)) { buttons |= BUTTON_MENU; } - if (data & (1 << 6)) { + if (tkey_data & (1 << 6)) { buttons |= BUTTON_LEFT; } - if (data & (1 << 5)) { + if (tkey_data & (1 << 5)) { buttons |= BUTTON_SELECT; } - if (data & (1 << 4)) { + if (tkey_data & (1 << 4)) { buttons |= BUTTON_RIGHT; } - if (data & (1 << 3)) { + if (tkey_data & (1 << 3)) { buttons |= BUTTON_DOWN; } diff --git a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c index 6093eb3054..3b57a50ec0 100644 --- a/firmware/target/arm/s5l8700/yps3/lcd-yps3.c +++ b/firmware/target/arm/s5l8700/yps3/lcd-yps3.c @@ -85,7 +85,7 @@ static void lcd_wcmd_data(unsigned int cmd, unsigned int data) lcd_wdata(data); } -void lcd_init1(void) +static void lcd_init1(void) { lcd_wcmd(0x11); lcd_delay(10000); @@ -157,7 +157,7 @@ void lcd_init1(void) lcd_wcmd(0x2C); } -void lcd_init2(void) +static void lcd_init2(void) { lcd_wcmd_data(0x00, 0x0001); lcd_delay(50000); @@ -234,7 +234,7 @@ void lcd_init2(void) } -void lcd_set_window1(int x, int y, int width, int height) +static void lcd_set_window1(int x, int y, int width, int height) { (void)x; (void)width; @@ -250,7 +250,7 @@ void lcd_set_window1(int x, int y, int width, int height) lcd_wdata(0); } -void lcd_set_window2(int x, int y, int width, int height) +static void lcd_set_window2(int x, int y, int width, int height) { lcd_wcmd_data(0x50, x); lcd_wcmd_data(0x51, x + width - 1); |