autolamp value in prefs should be bool

This commit is contained in:
Owen 2022-03-09 11:41:40 +01:00
parent cb78162ea4
commit f4bde8b77c
1 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
extern void flashLED(int flashtime); extern void flashLED(int flashtime);
extern int myRotation; // Rotation extern int myRotation; // Rotation
extern int lampVal; // The current Lamp value extern int lampVal; // The current Lamp value
extern int autoLamp; // Automatic lamp mode extern bool autoLamp; // Automatic lamp mode
extern int xclk; // Camera module clock speed extern int xclk; // Camera module clock speed
/* /*
@ -90,11 +90,11 @@ void loadPrefs(fs::FS &fs){
sensor_t * s = esp_camera_sensor_get(); sensor_t * s = esp_camera_sensor_get();
// process all the settings // process all the settings
lampVal = jsonExtract(prefs, "lamp").toInt(); lampVal = jsonExtract(prefs, "lamp").toInt();
autoLamp = jsonExtract(prefs, "autolamp").toInt(); if (jsonExtract(prefs, "autolamp").toInt() == 0) autoLamp = false; else autoLamp = true;
int xclkPref = jsonExtract(prefs, "xclk").toInt();
if (xclkPref != 0) xclk = xclkPref;
s->set_framesize(s, (framesize_t)jsonExtract(prefs, "framesize").toInt()); s->set_framesize(s, (framesize_t)jsonExtract(prefs, "framesize").toInt());
s->set_quality(s, jsonExtract(prefs, "quality").toInt()); s->set_quality(s, jsonExtract(prefs, "quality").toInt());
int xclkPref = jsonExtract(prefs, "xclk").toInt();
if (xclkPref != 0) xclk = xclkPref;
s->set_xclk(s, LEDC_TIMER_0, xclk); s->set_xclk(s, LEDC_TIMER_0, xclk);
s->set_brightness(s, jsonExtract(prefs, "brightness").toInt()); s->set_brightness(s, jsonExtract(prefs, "brightness").toInt());
s->set_contrast(s, jsonExtract(prefs, "contrast").toInt()); s->set_contrast(s, jsonExtract(prefs, "contrast").toInt());