summaryrefslogtreecommitdiff
path: root/firmware/drivers/button.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-04-01 23:48:03 +0000
committerJens Arnold <amiconn@rockbox.org>2006-04-01 23:48:03 +0000
commit3a3304fa31c081cfd41e125b814eab58f83422c0 (patch)
tree934cf96f4380c8fdbb9b31de256e4ad70115ef8a /firmware/drivers/button.c
parentbf9995214032a37dba88b50c72387f8ececf29c9 (diff)
downloadrockbox-3a3304fa31c081cfd41e125b814eab58f83422c0.tar.gz
rockbox-3a3304fa31c081cfd41e125b814eab58f83422c0.zip
greyscale iPod LCD: Working display flip. * Correct register definitions for HD66753. * Correct 1/3 and 2/3 greylevels. * Some tweaks.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9414 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/button.c')
-rw-r--r--firmware/drivers/button.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 99b5b06c69..6a95932763 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -694,30 +694,33 @@ void button_init(void)
694} 694}
695 695
696#ifdef HAVE_LCD_BITMAP /* only bitmap displays can be flipped */ 696#ifdef HAVE_LCD_BITMAP /* only bitmap displays can be flipped */
697#if (CONFIG_KEYPAD != IPOD_3G_PAD) && (CONFIG_KEYPAD != IPOD_4G_PAD)
698/* 697/*
699 * helper function to swap UP/DOWN, LEFT/RIGHT (and F1/F3 for Recorder) 698 * helper function to swap LEFT/RIGHT, UP/DOWN (if present), and F1/F3 (Recorder)
700 */ 699 */
701static int button_flip(int button) 700static int button_flip(int button)
702{ 701{
703 int newbutton; 702 int newbutton;
704 703
705 newbutton = button & 704 newbutton = button &
706 ~(BUTTON_UP | BUTTON_DOWN 705 ~(BUTTON_LEFT | BUTTON_RIGHT
707 | BUTTON_LEFT | BUTTON_RIGHT 706#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
707 | BUTTON_UP | BUTTON_DOWN
708#endif
708#if CONFIG_KEYPAD == RECORDER_PAD 709#if CONFIG_KEYPAD == RECORDER_PAD
709 | BUTTON_F1 | BUTTON_F3 710 | BUTTON_F1 | BUTTON_F3
710#endif 711#endif
711 ); 712 );
712 713
713 if (button & BUTTON_UP)
714 newbutton |= BUTTON_DOWN;
715 if (button & BUTTON_DOWN)
716 newbutton |= BUTTON_UP;
717 if (button & BUTTON_LEFT) 714 if (button & BUTTON_LEFT)
718 newbutton |= BUTTON_RIGHT; 715 newbutton |= BUTTON_RIGHT;
719 if (button & BUTTON_RIGHT) 716 if (button & BUTTON_RIGHT)
720 newbutton |= BUTTON_LEFT; 717 newbutton |= BUTTON_LEFT;
718#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
719 if (button & BUTTON_UP)
720 newbutton |= BUTTON_DOWN;
721 if (button & BUTTON_DOWN)
722 newbutton |= BUTTON_UP;
723#endif
721#if CONFIG_KEYPAD == RECORDER_PAD 724#if CONFIG_KEYPAD == RECORDER_PAD
722 if (button & BUTTON_F1) 725 if (button & BUTTON_F1)
723 newbutton |= BUTTON_F3; 726 newbutton |= BUTTON_F3;
@@ -727,10 +730,6 @@ static int button_flip(int button)
727 730
728 return newbutton; 731 return newbutton;
729} 732}
730#else
731/* We don't flip the iPod's keypad yet*/
732#define button_flip(x) (x)
733#endif
734 733
735/* 734/*
736 * set the flip attribute 735 * set the flip attribute