diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-11-07 05:31:05 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-11-07 05:31:05 +0000 |
| commit | 2b81bce27caeb3d4abb800dbac9bdf803d9170ea (patch) | |
| tree | 3c1e2de4ded51e7d673e12590b1b2935c8639a00 | |
| parent | 97aef4ce11aea50ed13f11b725a2147acfe6445c (diff) | |
| download | rockbox-2b81bce27caeb3d4abb800dbac9bdf803d9170ea.zip rockbox-2b81bce27caeb3d4abb800dbac9bdf803d9170ea.tar.gz rockbox-2b81bce27caeb3d4abb800dbac9bdf803d9170ea.tar.bz2 rockbox-2b81bce27caeb3d4abb800dbac9bdf803d9170ea.tar.xz | |
FS#9532 - e200v2 buttons
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19035 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c index fc27152..fb2eba2 100644 --- a/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c +++ b/firmware/target/arm/as3525/sansa-e200v2/button-e200v2.c @@ -70,10 +70,54 @@ void clickwheel_int(void) /* device buttons */ void button_int(void) { - unsigned char state; + int dir_save_b = 0; + int afsel_save_b = 0; + int dir_save_c = 0; + int afsel_save_c = 0; int_btn = BUTTON_NONE; + /* Save the current direction and afsel */ + dir_save_b = GPIOB_DIR; + afsel_save_b = GPIOB_AFSEL; + dir_save_c = GPIOC_DIR; + afsel_save_c = GPIOC_AFSEL; + + GPIOB_DIR = 0; + GPIOB_AFSEL = 0; + GPIOC_DIR = 0; + GPIOC_AFSEL = 0; + + /* These should not be needed with button event interupts */ + /* they are necessary now to clear out lcd data */ + GPIOC_PIN(0) |= 1; + GPIOC_PIN(1) |= 1; + GPIOC_PIN(2) |= 1; + GPIOC_PIN(3) |= 1; + GPIOC_PIN(4) |= 1; + GPIOC_PIN(5) |= 1; + GPIOC_PIN(6) |= 1; + GPIOC_PIN(7) |= 1; + + /* direct GPIO connections */ + if (GPIOB_PIN(4)) + int_btn |= BUTTON_POWER; + if (!GPIOC_PIN(6)) + int_btn |= BUTTON_DOWN; + if (!GPIOC_PIN(5)) + int_btn |= BUTTON_RIGHT; + if (!GPIOC_PIN(4)) + int_btn |= BUTTON_SELECT; + if (!GPIOC_PIN(3)) + int_btn |= BUTTON_LEFT; + if (!GPIOC_PIN(2)) + int_btn |= BUTTON_UP; + + /* return to settings needed for lcd */ + GPIOB_DIR = dir_save_b; + GPIOB_AFSEL = afsel_save_b; + GPIOC_DIR = dir_save_c; + GPIOC_AFSEL = afsel_save_c; } /* |