From 93d3d2d40805f41f4361af81cb58618c4f49acc5 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 29 Apr 2019 21:07:27 +0200 Subject: [PATCH] Fixes for volume UI handling. --- MicroDexed.ino | 2 +- UI.cpp | 6 +++--- config.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 0344262..42a7148 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -795,7 +795,7 @@ void initial_values_from_eeprom(void) void eeprom_write(void) { - autostore = 0; + autostore=0; eeprom_update_flag = true; } diff --git a/UI.cpp b/UI.cpp index f88f7fb..47f4893 100644 --- a/UI.cpp +++ b/UI.cpp @@ -45,7 +45,6 @@ void handle_ui(void) if (autostore >= AUTOSTORE_MS && (ui_main_state == UI_MAIN_VOICE_SELECTED || ui_main_state == UI_MAIN_BANK_SELECTED)) { - ui_show_main(); switch (ui_main_state) { case UI_MAIN_VOICE_SELECTED: @@ -245,6 +244,7 @@ void handle_ui(void) ui_state = UI_MAIN; lcd.clear(); enc[1].write(configuration.voice); + eeprom_write(); ui_show_main(); break; case UI_MAIN: @@ -434,12 +434,12 @@ void ui_show_volume(void) ui_back_to_main = 0; // erase old marker and show new marker - pos = map(configuration.vol * 100, 0, 100, 0, LCD_CHARS); + pos = map(configuration.vol * 100 + 0.5, 0, 100, 0, LCD_CHARS-1); if (ui_state != UI_VOLUME) { lcd.clear(); - lcd.show(0, 0, LCD_CHARS, "Volume"); + lcd.show(0, 0, LCD_CHARS-1, "Volume"); lcd.show(1, pos, 1, "*"); old_pos = pos; } diff --git a/config.h b/config.h index d60fc31..4da988e 100644 --- a/config.h +++ b/config.h @@ -89,12 +89,12 @@ #define REDUCE_LOUDNESS 1 #endif #define SAMPLE_RATE 44100 -#define SOFTEN_VALUE_CHANGE_STEPS 10 +#define SOFTEN_VALUE_CHANGE_STEPS 20 //************************************************************************************************* //* UI AND DATA-STORE SETTINGS //************************************************************************************************* -#define CONTROL_RATE_MS 100 +#define CONTROL_RATE_MS 50 #define TIMER_UI_HANDLING_MS 100 //*************************************************************************************************