Removed all traces of the repeat and release masks
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2684 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
7ec35e7828
commit
e45c069d69
3 changed files with 13 additions and 60 deletions
|
@ -334,15 +334,12 @@ bool viewer_run(char* file)
|
|||
int button;
|
||||
int col = 0;
|
||||
int ok;
|
||||
int oldmask;
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
/* no margins */
|
||||
lcd_setmargins(0, 0);
|
||||
#endif
|
||||
|
||||
oldmask = button_set_release(~0);
|
||||
|
||||
ok = viewer_init(file);
|
||||
if (!ok) {
|
||||
lcd_clear_display();
|
||||
|
@ -431,7 +428,5 @@ bool viewer_run(char* file)
|
|||
return true;
|
||||
}
|
||||
}
|
||||
button_set_release(oldmask);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,9 +47,6 @@ long last_keypress;
|
|||
/* speed repeat finishes at */
|
||||
#define REPEAT_INTERVAL_FINISH 2
|
||||
|
||||
static int repeat_mask = DEFAULT_REPEAT_MASK;
|
||||
static int release_mask = DEFAULT_RELEASE_MASK;
|
||||
|
||||
static int button_read(void);
|
||||
|
||||
static void button_tick(void)
|
||||
|
@ -79,10 +76,9 @@ static void button_tick(void)
|
|||
|
||||
/* Find out if a key has been released */
|
||||
diff = btn ^ lastbtn;
|
||||
if((btn & diff) == 0)
|
||||
if(diff && (btn & diff) == 0)
|
||||
{
|
||||
if(diff & release_mask)
|
||||
queue_post(&button_queue, BUTTON_REL | diff, NULL);
|
||||
queue_post(&button_queue, BUTTON_REL | diff, NULL);
|
||||
}
|
||||
|
||||
if ( btn )
|
||||
|
@ -111,36 +107,21 @@ static void button_tick(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(btn & repeat_mask ||
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
btn == BUTTON_OFF)
|
||||
#else
|
||||
btn == BUTTON_STOP)
|
||||
#endif
|
||||
if (count++ > REPEAT_START)
|
||||
{
|
||||
if (count++ > REPEAT_START)
|
||||
{
|
||||
/* Only repeat if a repeatable key is pressed */
|
||||
if(btn & repeat_mask)
|
||||
{
|
||||
post = true;
|
||||
repeat = true;
|
||||
/* initial repeat */
|
||||
count = REPEAT_INTERVAL_START;
|
||||
}
|
||||
/* Reboot if the OFF button is pressed long enough
|
||||
and we are connected to a charger. */
|
||||
post = true;
|
||||
repeat = true;
|
||||
/* initial repeat */
|
||||
count = REPEAT_INTERVAL_START;
|
||||
|
||||
/* Reboot if the OFF button is pressed long enough
|
||||
and we are connected to a charger. */
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
if(btn == BUTTON_OFF && charger_inserted())
|
||||
if(btn == BUTTON_OFF && charger_inserted())
|
||||
#elif HAVE_PLAYER_KEYPAD
|
||||
if(btn == BUTTON_STOP && charger_inserted())
|
||||
if(btn == BUTTON_STOP && charger_inserted())
|
||||
#endif
|
||||
system_reboot();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
count = 0;
|
||||
system_reboot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -197,20 +178,6 @@ int button_get_w_tmo(int ticks)
|
|||
return BUTTON_NONE;
|
||||
}
|
||||
|
||||
int button_set_repeat(int newmask)
|
||||
{
|
||||
int oldmask = repeat_mask;
|
||||
repeat_mask = newmask;
|
||||
return oldmask;
|
||||
}
|
||||
|
||||
int button_set_release(int newmask)
|
||||
{
|
||||
int oldmask = release_mask;
|
||||
release_mask = newmask;
|
||||
return oldmask;
|
||||
}
|
||||
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
|
||||
/* AJBR buttons are connected to the CPU as follows:
|
||||
|
|
|
@ -28,8 +28,6 @@ extern long last_keypress;
|
|||
void button_init (void);
|
||||
int button_get (bool block);
|
||||
int button_get_w_tmo(int ticks);
|
||||
int button_set_repeat(int newmask);
|
||||
int button_set_release(int newmask);
|
||||
|
||||
/* Shared button codes */
|
||||
#define BUTTON_NONE 0x0000
|
||||
|
@ -59,9 +57,6 @@ int button_set_release(int newmask);
|
|||
#define BUTTON_F2 0x0200
|
||||
#define BUTTON_F3 0x0400
|
||||
|
||||
#define DEFAULT_REPEAT_MASK (BUTTON_LEFT | BUTTON_RIGHT | \
|
||||
BUTTON_UP | BUTTON_DOWN)
|
||||
|
||||
#define ALL_BUTTONS (BUTTON_ON | BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | \
|
||||
BUTTON_RIGHT | BUTTON_OFF | BUTTON_PLAY | BUTTON_F1 | \
|
||||
BUTTON_F2 | BUTTON_F3)
|
||||
|
@ -73,15 +68,11 @@ int button_set_release(int newmask);
|
|||
#define BUTTON_PLAY BUTTON_UP
|
||||
#define BUTTON_STOP BUTTON_DOWN
|
||||
|
||||
#define DEFAULT_REPEAT_MASK (BUTTON_LEFT | BUTTON_RIGHT)
|
||||
|
||||
#define ALL_BUTTONS (BUTTON_ON | BUTTON_UP | BUTTON_DOWN | BUTTON_LEFT | \
|
||||
BUTTON_RIGHT | BUTTON_MENU)
|
||||
|
||||
#endif /* HAVE_PLAYER_KEYPAD */
|
||||
|
||||
#define DEFAULT_RELEASE_MASK ALL_BUTTONS
|
||||
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue