1
0
Fork 0
forked from len0rd/rockbox

audiohw: avoid magic numbers for DAC power mode

Define proper symbolic constants for power mode. Also allow
targets to define the default power mode setting.

Change-Id: Ia07cf854dce47d0a6aa88e067471f1ff9fbc45fb
This commit is contained in:
Aidan MacDonald 2022-01-10 21:50:32 +00:00
parent 18b3e91707
commit dac3175445
6 changed files with 20 additions and 7 deletions

View file

@ -351,6 +351,12 @@ static const char graphic_numeric[] = "graphic,numeric";
# endif
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE
# ifndef TARGET_DEFAULT_DAC_POWER_MODE
# define TARGET_DEFAULT_DAC_POWER_MODE SOUND_HIGH_POWER
# endif
#endif
#if LCD_DEPTH > 1
static const char* list_pad_formatter(char *buffer, size_t buffer_size,
int val, const char *unit)
@ -877,7 +883,8 @@ const struct settings_list settings[] = {
#endif
#ifdef AUDIOHW_HAVE_POWER_MODE
CHOICE_SETTING(F_SOUNDSETTING, power_mode, LANG_DAC_POWER_MODE, 0,
CHOICE_SETTING(F_SOUNDSETTING, power_mode, LANG_DAC_POWER_MODE,
TARGET_DEFAULT_DAC_POWER_MODE,
"dac_power_mode", "high,low", sound_set_power_mode,
2, ID2P(LANG_DAC_POWER_HIGH), ID2P(LANG_DAC_POWER_LOW)),
#endif