summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/menus/sound_menu.c13
-rw-r--r--firmware/sound.c4
2 files changed, 12 insertions, 5 deletions
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index b88fc2a043..00fe006399 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -38,6 +38,14 @@
#include "option_select.h"
#include "misc.h"
+static const char* vol_limit_format(char* buffer, size_t buffer_size, int value,
+ const char* unit)
+{
+ (void)unit;
+ format_sound_value(buffer, buffer_size, SOUND_VOLUME, value);
+ return buffer;
+}
+
static int volume_limit_callback(int action,
const struct menu_item_ex *this_item,
struct gui_synclist *this_list)
@@ -51,13 +59,13 @@ static int volume_limit_callback(int action,
volume_limit_int_setting.min = sound_min(SOUND_VOLUME);
volume_limit_int_setting.max = sound_max(SOUND_VOLUME);
volume_limit_int_setting.step = sound_steps(SOUND_VOLUME);
- volume_limit_int_setting.formatter = NULL;
+ volume_limit_int_setting.formatter = vol_limit_format;
volume_limit_int_setting.get_talk_id = NULL;
struct settings_list setting;
setting.flags = F_BANFROMQS|F_INT_SETTING|F_T_INT|F_NO_WRAP;
setting.lang_id = LANG_VOLUME_LIMIT;
- setting.default_val.int_ = sound_max(SOUND_VOLUME);
+ setting.default_val.int_ = volume_limit_int_setting.max;
setting.int_setting = &volume_limit_int_setting;
switch (action)
@@ -253,4 +261,3 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
,&speaker_mode
#endif
);
-
diff --git a/firmware/sound.c b/firmware/sound.c
index 6fe6115406..2a423177a7 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -54,7 +54,7 @@ static const struct sound_setting_entry * get_setting_entry(int setting)
{ "", 0, 0, 0, 0, 0 };
static const struct sound_setting_entry default_entry =
- { &default_info, NULL };
+ { &default_info, NULL };
if ((unsigned)setting >= ARRAYLEN(sound_setting_entries))
return &default_entry;
@@ -120,7 +120,7 @@ int sound_current(int setting)
{
switch(setting)
{
-#ifndef BOOTLOADER
+#ifndef BOOTLOADER
#ifndef PLATFORM_HAS_VOLUME_CHANGE
SOUND_CUR_SET(VOLUME, global_settings.volume)
#endif