Fixing volume menu.

Fixing storing sound number to EEPROM after loading.
Fixing loading stored sound number at startup.
master
Holger Wirtz 6 years ago
parent b113dd6fb1
commit fb914b52c8
  1. 7
      MicroMDAEPiano.ino
  2. 27
      UI.hpp

@ -512,13 +512,16 @@ void initial_values_from_eeprom(void)
} }
else else
{ {
EEPROM_readAnything(EEPROM_CONFIGURATIONS + sizeof(config_t) * (sound - 1), configuration); sound = EEPROM.read(EEPROM_SOUND);
master_volume = EEPROM.read(EEPROM_MASTER_VOLUME); master_volume = EEPROM.read(EEPROM_MASTER_VOLUME);
EEPROM_readAnything(EEPROM_CONFIGURATIONS + sizeof(config_t) * (sound - 1), configuration);
Serial.print(F(" - OK, loading")); Serial.print(F(" - OK, loading"));
} }
#ifdef DEBUG #ifdef DEBUG
Serial.print(F(" - Master volume: ")); Serial.print(F(" - Master volume: "));
Serial.println(master_volume, DEC); Serial.print(master_volume, DEC);
Serial.print(F(" - Sound: "));
Serial.println(sound, DEC);
Serial.print(F("Max configs in EEPROM: ")); Serial.print(F("Max configs in EEPROM: "));
Serial.println(MAX_SOUNDS); Serial.println(MAX_SOUNDS);
show_sound(); show_sound();

@ -1,5 +1,25 @@
/* /*
LiquidMenuTest MicroMDAEPiano
MicroMDAEPiano is a port of the MDA-EPiano sound engine
(https://sourceforge.net/projects/mda-vst/) for the Teensy-3.5/3.6 with audio shield.
(c)2019 H. Wirtz <wirtz@parasitstudio.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
/* Don't forget to change in MAX_FUNCTIONS to 24 in ../libraries/LiquidMenu/src/LiquidMenu_config.h /* Don't forget to change in MAX_FUNCTIONS to 24 in ../libraries/LiquidMenu/src/LiquidMenu_config.h
@ -8,7 +28,7 @@
const uint8_t MAX_VARIABLES = 5; ///< @note Default: 5 const uint8_t MAX_VARIABLES = 5; ///< @note Default: 5
/// Configures the number of available functions per line. /// Configures the number of available functions per line.
const uint8_t MAX_FUNCTIONS = 42; ///< @note Default: 8 const uint8_t MAX_FUNCTIONS = 39; ///< @note Default: 8
/// Configures the number of available lines per screen. /// Configures the number of available lines per screen.
const uint8_t MAX_LINES = 19; ///< @note Default: 12 const uint8_t MAX_LINES = 19; ///< @note Default: 12
@ -17,7 +37,7 @@
const uint8_t MAX_SCREENS = 14; ///< @note Default: 14 const uint8_t MAX_SCREENS = 14; ///< @note Default: 14
/// Configures the number of available menus per menus system. /// Configures the number of available menus per menus system.
const uint8_t MAX_MENUS = 41; ///< @note Default: 8 const uint8_t MAX_MENUS = 42; ///< @note Default: 8
*/ */
@ -1716,6 +1736,7 @@ void load_sound(void)
Serial.print(F("Load sound ")); Serial.print(F("Load sound "));
Serial.println(sound); Serial.println(sound);
#endif #endif
EEPROM.write(EEPROM_SOUND, sound);
config_from_eeprom(); config_from_eeprom();
} }

Loading…
Cancel
Save