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