summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-01-10 21:50:32 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-01-16 19:35:40 -0500
commitdac3175445b6e76a29c1550da9cece13dfaf7f8c (patch)
tree2f1475163428f3c5af431b1c3dec630d13365c8f /apps
parent18b3e91707e42873eab833f0f3da709062207ba7 (diff)
downloadrockbox-dac3175445b6e76a29c1550da9cece13dfaf7f8c.tar.gz
rockbox-dac3175445b6e76a29c1550da9cece13dfaf7f8c.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/settings_list.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 982b483874..795d42ceba 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -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