Fixed volume setting
This commit is contained in:
@@ -85,6 +85,11 @@ void loadSettings()
|
||||
SHOW_BAT = Settings.getBool("BAT", true);
|
||||
#endif
|
||||
SOUND_ACTIVE = Settings.getBool("SOUND", true);
|
||||
#ifndef ULANZI
|
||||
//Settings.putUInt("VOL", VOLUME_PERCENT);
|
||||
VOLUME_PERCENT = Settings.getUInt("VOL", 50);
|
||||
VOLUME = map(VOLUME_PERCENT, 0, 100, 0, 30);
|
||||
#endif
|
||||
Settings.end();
|
||||
uniqueID = getID();
|
||||
MQTT_PREFIX = String(uniqueID);
|
||||
@@ -114,6 +119,9 @@ void saveSettings()
|
||||
Settings.putBool("BAT", SHOW_BAT);
|
||||
#endif
|
||||
Settings.putBool("SOUND", SOUND_ACTIVE);
|
||||
#ifndef ULANZI
|
||||
Settings.putUInt("VOL", VOLUME_PERCENT);
|
||||
#endif
|
||||
Settings.end();
|
||||
}
|
||||
|
||||
@@ -187,7 +195,7 @@ bool ALARM_ACTIVE;
|
||||
uint16_t TEXTCOLOR_565 = 0xFFFF;
|
||||
bool SOUND_ACTIVE;
|
||||
String BOOT_SOUND = "";
|
||||
uint8_t VOLUME_PERCENT = 50;
|
||||
uint8_t VOLUME = map(VOLUME_PERCENT, 0, 100, 0, 30);
|
||||
uint8_t VOLUME_PERCENT;
|
||||
uint8_t VOLUME;
|
||||
int MATRIX_LAYOUT;
|
||||
bool UPDATE_AVAILABLE = false;
|
||||
@@ -322,7 +322,7 @@ void MenuManager_::leftButton()
|
||||
break;
|
||||
#ifndef ULANZI
|
||||
case VolumeMenu:
|
||||
VOLUME_PERCENT = (VOLUME_PERCENT % 100) + 1;
|
||||
VOLUME_PERCENT = (VOLUME_PERCENT % 100) - 1;
|
||||
VOLUME = map(VOLUME_PERCENT, 0, 100, 0, 30);
|
||||
PeripheryManager.setVolume(VOLUME);
|
||||
#endif
|
||||
|
||||
@@ -58,10 +58,10 @@ void BootAnimation(void *parameter)
|
||||
|
||||
void setup()
|
||||
{
|
||||
loadSettings();
|
||||
Serial.begin(9600);
|
||||
PeripheryManager.setup();
|
||||
delay(500);
|
||||
loadSettings();
|
||||
ServerManager.loadSettings();
|
||||
DisplayManager.setup();
|
||||
DisplayManager.HSVtext(9, 6, VERSION, true);
|
||||
|
||||
Reference in New Issue
Block a user