diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-01-10 21:50:32 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-01-16 19:35:40 -0500 |
commit | dac3175445b6e76a29c1550da9cece13dfaf7f8c (patch) | |
tree | 2f1475163428f3c5af431b1c3dec630d13365c8f /apps | |
parent | 18b3e91707e42873eab833f0f3da709062207ba7 (diff) | |
download | rockbox-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.c | 9 |
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"; | |||
351 | # endif | 351 | # endif |
352 | #endif | 352 | #endif |
353 | 353 | ||
354 | #ifdef AUDIOHW_HAVE_POWER_MODE | ||
355 | # ifndef TARGET_DEFAULT_DAC_POWER_MODE | ||
356 | # define TARGET_DEFAULT_DAC_POWER_MODE SOUND_HIGH_POWER | ||
357 | # endif | ||
358 | #endif | ||
359 | |||
354 | #if LCD_DEPTH > 1 | 360 | #if LCD_DEPTH > 1 |
355 | static const char* list_pad_formatter(char *buffer, size_t buffer_size, | 361 | static const char* list_pad_formatter(char *buffer, size_t buffer_size, |
356 | int val, const char *unit) | 362 | int val, const char *unit) |
@@ -877,7 +883,8 @@ const struct settings_list settings[] = { | |||
877 | #endif | 883 | #endif |
878 | 884 | ||
879 | #ifdef AUDIOHW_HAVE_POWER_MODE | 885 | #ifdef AUDIOHW_HAVE_POWER_MODE |
880 | CHOICE_SETTING(F_SOUNDSETTING, power_mode, LANG_DAC_POWER_MODE, 0, | 886 | CHOICE_SETTING(F_SOUNDSETTING, power_mode, LANG_DAC_POWER_MODE, |
887 | TARGET_DEFAULT_DAC_POWER_MODE, | ||
881 | "dac_power_mode", "high,low", sound_set_power_mode, | 888 | "dac_power_mode", "high,low", sound_set_power_mode, |
882 | 2, ID2P(LANG_DAC_POWER_HIGH), ID2P(LANG_DAC_POWER_LOW)), | 889 | 2, ID2P(LANG_DAC_POWER_HIGH), ID2P(LANG_DAC_POWER_LOW)), |
883 | #endif | 890 | #endif |