YP-R0 keypad: recording screen and FM recording keys

The keymap had no recording screen context, so on the recording screen
no key produced ACTION_REC_PAUSE and recording could not be started; nor
did the FM screen have a record action.

- recording screen: User starts and pauses, held opens a new file;
  left/right set the gain of the selected line; Menu opens the settings
- FM screen: User records the radio (FM_RECORD enabled for this keypad)

User is the Rec key on the Samsung YP-CP3, which shares this keypad.

Tested only in a YP-CP3 build, not yet on hardware; the YP-R0 itself was
not built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I655865d0dcf3e72da4e2d1cba24bc296919ec261
This commit is contained in:
Marcin Bukat 2026-09-25 16:16:27 +02:00
parent a33b0c7360
commit 3fbf975ecc
2 changed files with 24 additions and 0 deletions

View file

@ -239,6 +239,9 @@ static const struct button_mapping button_context_radio[] = {
{ ACTION_FM_PLAY, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT },
{ ACTION_FM_NEXT_PRESET, BUTTON_USER | BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_FM_PREV_PRESET, BUTTON_USER | BUTTON_LEFT, BUTTON_NONE },
#ifdef HAVE_RECORDING
{ ACTION_FM_RECORD, BUTTON_USER | BUTTON_REL, BUTTON_USER },
#endif
/* Volume */
{ ACTION_SETTINGS_INC, BUTTON_UP | BUTTON_REPEAT, BUTTON_NONE },
@ -252,6 +255,22 @@ static const struct button_mapping button_context_radio[] = {
{ ACTION_STD_NEXTREPEAT, BUTTON_RIGHT | BUTTON_REPEAT, BUTTON_NONE },
}; /* button_context_radio */
#ifdef HAVE_RECORDING
/* User - the Rec key on the YP-CP3 - starts and pauses, held opens a new
* file; left/right set the gain of the selected line */
static const struct button_mapping button_context_recscreen[] = {
{ ACTION_REC_PAUSE, BUTTON_USER|BUTTON_REL, BUTTON_USER },
{ ACTION_REC_NEWFILE, BUTTON_USER|BUTTON_REPEAT, BUTTON_USER },
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
{ ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
{ ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
}; /* button_context_recscreen */
#endif
const struct button_mapping* get_context_mapping(int context)
{
switch (context & ~CONTEXT_LOCKED)
@ -296,6 +315,10 @@ const struct button_mapping* get_context_mapping(int context)
return button_context_pitchscreen;
case CONTEXT_KEYBOARD:
return button_context_keyboard;
#ifdef HAVE_RECORDING
case CONTEXT_RECSCREEN:
return button_context_recscreen;
#endif
}
return button_context_standard;
}

View file

@ -106,6 +106,7 @@
#define FM_PLAY
#define FM_PREV_PRESET
#define FM_NEXT_PRESET
#define FM_RECORD
#elif (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD)
#define FM_PRESET_ADD