diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-12-12 13:23:33 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-12-12 13:23:33 +0000 |
commit | 006b2c1c25607d7643bb6cd59052b74197000d06 (patch) | |
tree | 7f733d0fbcccea34e9a0d6ed237af8f24836b794 /firmware/drivers/button.c | |
parent | 503ce1bc0426fc7987371268db88dfc29dcf3fee (diff) | |
download | rockbox-006b2c1c25607d7643bb6cd59052b74197000d06.tar.gz rockbox-006b2c1c25607d7643bb6cd59052b74197000d06.zip |
adjustments for Neo
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4130 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r-- | firmware/drivers/button.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c index 847a0ba82d..c0cd046db6 100644 --- a/firmware/drivers/button.c +++ b/firmware/drivers/button.c | |||
@@ -328,4 +328,38 @@ static int button_read(void) | |||
328 | return btn; | 328 | return btn; |
329 | } | 329 | } |
330 | 330 | ||
331 | #elif HAVE_NEO_KEYPAD | ||
332 | static bool mStation = false; | ||
333 | void button_init(void) | ||
334 | { | ||
335 | /* set port pins as input */ | ||
336 | PAIOR &= ~0x4000; //PA14 for stop button | ||
337 | |||
338 | queue_init(&button_queue); | ||
339 | tick_add_task(button_tick); | ||
340 | |||
341 | last_keypress = current_tick; | ||
342 | } | ||
343 | int button_read(void) | ||
344 | { | ||
345 | int btn=BUTTON_NONE; | ||
346 | |||
347 | btn|=((~PCDR)&0xFF); | ||
348 | |||
349 | /* mStation does not have a stop button and this floods the button queue | ||
350 | with stops if used on a mStation */ | ||
351 | if (!mStation) | ||
352 | btn|=((~(PADR>>6))&0x100); | ||
353 | |||
354 | return btn; | ||
355 | } | ||
356 | |||
357 | /* This function adds a button press event to the button queue, and this | ||
358 | really isn't anything Neo-specific but might be subject for adding to | ||
359 | the generic button driver */ | ||
360 | int button_add(unsigned int button) | ||
361 | { | ||
362 | queue_post(&button_queue,button,NULL); | ||
363 | return 1; | ||
364 | } | ||
331 | #endif | 365 | #endif |