Skip to content

Commit 8e994f4

Browse files
committed
fix autoLamp
1 parent 6fd34f0 commit 8e994f4

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

data/www/dump.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ <h1>ESP32 Cam Webserver</h1>
125125
bodyHtml += 'Filesystem: ' + data.storage_size + data.storage_units +
126126
', used: ' + data.storage_used + data.storage_units + '<br>';
127127

128-
bodyHtml += '<h2>Serial</h2>';
129-
bodyHtml += data.serial_buf;
130-
128+
if(data.serial_buf.lenght == 0) {
129+
bodyHtml += '<h2>Serial</h2>';
130+
bodyHtml += data.serial_buf;
131+
}
131132
bodyHtml += '<br><br>';
132133

133134
contentBody.innerHTML = bodyHtml;

src/app_cam.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ int CLAppCam::start() {
8080
#if defined(LAMP_PIN)
8181
ledcSetup(lampChannel, pwmfreq, pwmresolution); // configure LED PWM channel
8282
ledcAttachPin(LAMP_PIN, lampChannel); // attach the GPIO pin to the channel
83-
if (autoLamp) setLamp(0); // set default value
84-
else setLamp();
83+
setLamp(0); // set default value
8584
#endif
8685
} else {
8786
Serial.println("No lamp, or lamp disabled in config");

src/app_cam.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CLAppCam : public CLAppComponent {
6767
#if defined(LAMP_DISABLE)
6868
int lampVal = -1; // lamp is disabled in config
6969
#elif defined(LAMP_PIN)
70-
int lampVal = constrain(LAMP_DEFAULT,0,100);
70+
int lampVal = 0;
7171
#else
7272
int lampVal = -1; // no lamp pin assigned
7373
#endif

src/app_component.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ int CLAppComponent::parsePrefs(jparse_ctx_t *jctx) {
5555
return OS_FAIL;
5656
}
5757

58-
int ret = json_parse_start(jctx, conn_json.c_str(), conn_json.length());
58+
char *cn_ptr = const_cast<char*>(conn_json.c_str());
59+
60+
int ret = json_parse_start(jctx, cn_ptr, conn_json.length());
5961
if(ret != OS_SUCCESS) {
6062
Serial.printf("Preference file %s could not be parsed; using system defaults.\r\n", conn_file);
6163
return OS_FAIL;

src/app_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
// #define LED_DISABLE
3636

3737
// Uncomment to disable the illumination lamp features
38-
#define LAMP_DISABLE
38+
// #define LAMP_DISABLE
3939

4040
// Uncomment this line to use LittleFS instead of SD.
4141
// NOTE!

0 commit comments

Comments
 (0)