Skip to content

Commit

Permalink
Strip trailing whitespace everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
easytarget committed Mar 9, 2022
1 parent 3fc9389 commit 322187c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ static esp_err_t dump_handler(httpd_req_t *req){
d+= sprintf(d,"<link rel=\"stylesheet\" type=\"text/css\" href=\"/style.css\">\n");
d+= sprintf(d,"</head>\n");
d+= sprintf(d,"<body>\n");
d+= sprintf(d,"<img src=\"/logo.svg\" style=\"position: relative; float: right;\">\n");
d+= sprintf(d,"<img src=\"/logo.svg\" style=\"position: relative; float: right;\">\n");
if (critERR.length() > 0) {
d+= sprintf(d,"<span style=\"color:red;\">%s<hr></span>\n", critERR.c_str());
d+= sprintf(d,"<h2 style=\"color:red;\">(the serial log may give more information)</h2><br>\n");
Expand Down
10 changes: 5 additions & 5 deletions camera_pins.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
/*
* Pin definitions for some common ESP-CAM modules
*
*
* Select the module to use in myconfig.h
* Defaults to AI-THINKER CAM module
*
*
*/
#if defined(CAMERA_MODEL_AI_THINKER)
//
Expand Down Expand Up @@ -33,7 +33,7 @@

#elif defined(CAMERA_MODEL_WROVER_KIT)
//
// ESP WROVER
// ESP WROVER
// https://dl.espressif.com/dl/schematics/ESP-WROVER-KIT_SCH-2.pdf
//
#define PWDN_GPIO_NUM -1
Expand Down Expand Up @@ -189,7 +189,7 @@

#elif defined(CAMERA_MODEL_TTGO_T_JOURNAL)
//
// LilyGO TTGO T-Journal ESP32; with OLED! but not used here.. :-(
// LilyGO TTGO T-Journal ESP32; with OLED! but not used here.. :-(
#define PWDN_GPIO_NUM 0
#define RESET_GPIO_NUM 15
#define XCLK_GPIO_NUM 27
Expand Down
2 changes: 1 addition & 1 deletion css.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Master CSS file for the camera pages
*/

const uint8_t style_css[] = R"=====(/*
const uint8_t style_css[] = R"=====(/*
* CSS for the esp32 cam webserver
*/

Expand Down
48 changes: 24 additions & 24 deletions esp32-cam-webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* greater feedback via a status LED, and the HTML contents are present in plain text
* for easy modification.
*
* A camera name can now be configured, and wifi details can be stored in an optional
* A camera name can now be configured, and wifi details can be stored in an optional
* header file to allow easier updated of the repo.
*
* The web UI has had changes to add the lamp control, rotation, a standalone viewer,
Expand All @@ -26,7 +26,7 @@
*/


/*
/*
* FOR NETWORK AND HARDWARE SETTINGS COPY OR RENAME 'myconfig.sample.h' TO 'myconfig.h' AND EDIT THAT.
*
* By default this sketch will assume an AI-THINKER ESP-CAM and create
Expand All @@ -42,7 +42,7 @@
#warning "Using Defaults: Copy myconfig.sample.h to myconfig.h and edit that to use your own settings"
#define WIFI_AP_ENABLE
#define CAMERA_MODEL_AI_THINKER
struct station { const char ssid[65]; const char password[65]; const bool dhcp;}
struct station { const char ssid[65]; const char password[65]; const bool dhcp;}
stationList[] = {{"ESP32-CAM-CONNECT","InsecurePassword", true}};
#endif

Expand Down Expand Up @@ -103,7 +103,7 @@ int stationCount = sizeof(stationList)/sizeof(stationList[0]);

// If we have AP mode enabled, ignore first entry in the stationList[]
#if defined(WIFI_AP_ENABLE)
int firstStation = 1;
int firstStation = 1;
#else
int firstStation = 0;
#endif
Expand Down Expand Up @@ -158,7 +158,7 @@ int myRotation = CAM_ROTATION;
#else
int lampVal = 0; //default to off
#endif
#else
#else
int lampVal = -1; // no lamp pin assigned
#endif

Expand Down Expand Up @@ -234,7 +234,7 @@ void handleSerial() {
while (Serial.available()) Serial.read(); // chomp the buffer
}

// Notification LED
// Notification LED
void flashLED(int flashtime) {
#ifdef LED_PIN // If we have it; flash it.
digitalWrite(LED_PIN, LED_ON); // On at full power.
Expand Down Expand Up @@ -297,7 +297,7 @@ void WifiSetup() {
flashLED(300);
Serial.println("Starting WiFi");

// Disable power saving on WiFi to improve responsiveness
// Disable power saving on WiFi to improve responsiveness
// (https://github.com/espressif/arduino-esp32/issues/1484)
WiFi.setSleep(false);

Expand All @@ -311,13 +311,13 @@ void WifiSetup() {
byte mac[6] = {0,0,0,0,0,0};
WiFi.macAddress(mac);
Serial.printf("MAC address: %02X:%02X:%02X:%02X:%02X:%02X\r\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);

int bestStation = -1;
long bestRSSI = -1024;
char bestSSID[65] = "";
uint8_t bestBSSID[6];
if (stationCount > firstStation) {
// We have a list to scan
// We have a list to scan
Serial.printf("Scanning local Wifi Networks\r\n");
int stationsFound = WiFi.scanNetworks();
Serial.printf("%i networks found\r\n", stationsFound);
Expand All @@ -330,15 +330,15 @@ void WifiSetup() {
Serial.printf("%3i : [%s] %s (%i)", i + 1, thisBSSID.c_str(), thisSSID.c_str(), thisRSSI);
// Scan our list of known external stations
for (int sta = firstStation; sta < stationCount; sta++) {
if ((strcmp(stationList[sta].ssid, thisSSID.c_str()) == 0) ||
if ((strcmp(stationList[sta].ssid, thisSSID.c_str()) == 0) ||
(strcmp(stationList[sta].ssid, thisBSSID.c_str()) == 0)) {
Serial.print(" - Known!");
// Chose the strongest RSSI seen
if (thisRSSI > bestRSSI) {
bestStation = sta;
strncpy(bestSSID, thisSSID.c_str(), 64);
// Convert char bssid[] to a byte array
parseBytes(thisBSSID.c_str(), ':', bestBSSID, 6, 16);
parseBytes(thisBSSID.c_str(), ':', bestBSSID, 6, 16);
bestRSSI = thisRSSI;
}
}
Expand All @@ -348,11 +348,11 @@ void WifiSetup() {
}
} else {
// No list to scan, therefore we are an accesspoint
accesspoint = true;
accesspoint = true;
}

if (bestStation == -1) {
if (!accesspoint) {
if (!accesspoint) {
#if defined(WIFI_AP_ENABLE)
Serial.println("No known networks found, entering AccessPoint fallback mode");
accesspoint = true;
Expand All @@ -363,14 +363,14 @@ void WifiSetup() {
Serial.println("AccessPoint mode selected in config");
}
} else {
Serial.printf("Connecting to Wifi Network %d: [%02X:%02X:%02X:%02X:%02X:%02X] %s \r\n",
bestStation, bestBSSID[0], bestBSSID[1], bestBSSID[2], bestBSSID[3],
Serial.printf("Connecting to Wifi Network %d: [%02X:%02X:%02X:%02X:%02X:%02X] %s \r\n",
bestStation, bestBSSID[0], bestBSSID[1], bestBSSID[2], bestBSSID[3],
bestBSSID[4], bestBSSID[5], bestSSID);
// Apply static settings if necesscary
if (stationList[bestStation].dhcp == false) {
#if defined(ST_IP)
Serial.println("Applying static IP settings");
#if !defined (ST_GATEWAY) || !defined (ST_NETMASK)
#if !defined (ST_GATEWAY) || !defined (ST_NETMASK)
#error "You must supply both Gateway and NetMask when specifying a static IP address"
#endif
IPAddress staticIP(ST_IP);
Expand Down Expand Up @@ -400,7 +400,7 @@ void WifiSetup() {
WiFi.begin(bestSSID, stationList[bestStation].password, 0, bestBSSID);

// Wait to connect, or timeout
unsigned long start = millis();
unsigned long start = millis();
while ((millis() - start <= WIFI_WATCHDOG) && (WiFi.status() != WL_CONNECTED)) {
delay(500);
Serial.print('.');
Expand Down Expand Up @@ -518,7 +518,7 @@ void setup() {
delay(200); // a short delay to let spi bus settle after SPIFFS init
}

// Create camera config structure; and populate with hardware and other defaults
// Create camera config structure; and populate with hardware and other defaults
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
Expand Down Expand Up @@ -574,7 +574,7 @@ void setup() {
critERR += "<p>We will continue to reboot once per minute since this error sometimes clears automatically.</p>";
// Start a 60 second watchdog timer
esp_task_wdt_init(60,true);
esp_task_wdt_add(NULL);
esp_task_wdt_add(NULL);
} else {
Serial.println("Camera init succeeded");

Expand Down Expand Up @@ -621,7 +621,7 @@ void setup() {
/*
* Add any other defaults you want to apply at startup here:
* uncomment the line and set the value as desired (see the comments)
*
*
* these are defined in the esp headers here:
* https://github.com/espressif/esp32-camera/blob/master/driver/include/sensor.h#L149
*/
Expand Down Expand Up @@ -688,7 +688,7 @@ void setup() {
// Start OTA once connected
Serial.println("Setting up OTA");
// Port defaults to 3232
// ArduinoOTA.setPort(3232);
// ArduinoOTA.setPort(3232);
// Hostname defaults to esp3232-[MAC]
ArduinoOTA.setHostname(myName);
// No authentication by default
Expand Down Expand Up @@ -765,7 +765,7 @@ void setup() {
}

void loop() {
/*
/*
* Just loop forever, reconnecting Wifi As necesscary in client mode
* The stream and URI handler processes initiated by the startCameraServer() call at the
* end of setup() will handle the camera and UI processing from now on.
Expand All @@ -781,12 +781,12 @@ void loop() {
if (captivePortal) dnsServer.processNextRequest();
}
} else {
// client mode can fail; so reconnect as appropriate
// client mode can fail; so reconnect as appropriate
static bool warned = false;
if (WiFi.status() == WL_CONNECTED) {
// We are connected, wait a bit and re-check
if (warned) {
// Tell the user if we have just reconnected
// Tell the user if we have just reconnected
Serial.println("WiFi reconnected");
warned = false;
}
Expand Down
10 changes: 5 additions & 5 deletions index_other.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const uint8_t index_simple_html[] = R"=====(<!doctype html>
updateConfig(el);
} else if(!updateRemote){
if(el.id === "lamp"){
if (value == -1) {
if (value == -1) {
hide(lampGroup)
} else {
show(lampGroup)
Expand All @@ -142,7 +142,7 @@ const uint8_t index_simple_html[] = R"=====(<!doctype html>
streamURL = value;
streamButton.setAttribute("title", `Start the stream :: {streamURL}`);
console.log('Stream URL set to:' + value);
}
}
}
}
Expand Down Expand Up @@ -408,7 +408,7 @@ const uint8_t streamviewer_html[] = R"=====(<!doctype html>
} else if(el.id === "stream_url"){
streamURL = value;
console.log('Stream URL set to:' + value);
}
}
}
}
Expand Down Expand Up @@ -460,7 +460,7 @@ const uint8_t streamviewer_html[] = R"=====(<!doctype html>

size_t streamviewer_html_len = sizeof(streamviewer_html)-1;

/* Captive Portal page
/* Captive Portal page
we replace the <> delimited strings with correct values as it is served */

const std::string portal_html = R"=====(<!doctype html>
Expand Down Expand Up @@ -489,7 +489,7 @@ const std::string portal_html = R"=====(<!doctype html>
</body>
</html>)=====";

/* Error page
/* Error page
we replace the <> delimited strings with correct values as it is served */

const std::string error_html = R"=====(<!doctype html>
Expand Down
8 changes: 4 additions & 4 deletions index_ov2640.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ const uint8_t index_ov2640_html[] = R"=====(<!doctype html>
} else if(el.id === "awb_gain"){
value ? show(wb) : hide(wb)
} else if(el.id === "lamp"){
if (value == -1) {
if (value == -1) {
hide(lampGroup)
hide(autolampGroup)
} else {
Expand Down Expand Up @@ -378,7 +378,7 @@ const uint8_t index_ov2640_html[] = R"=====(<!doctype html>
show(streamGroup)
console.log('Stream URL set to: ' + streamURL);
console.log('Stream Viewer URL set to: ' + viewerURL);
}
}
}
}

Expand Down Expand Up @@ -488,7 +488,7 @@ const uint8_t index_ov2640_html[] = R"=====(<!doctype html>
}

// Attach actions to controls

streamLink.onclick = () => {
stopStream();
window.open(viewerURL, "_blank");
Expand Down Expand Up @@ -579,7 +579,7 @@ const uint8_t index_ov2640_html[] = R"=====(<!doctype html>
swapButton.onclick = () => {
window.open('/?view=simple','_self');
}

savePrefsButton.onclick = () => {
if (confirm("Save the current preferences?")) {
updateConfig(savePrefsButton);
Expand Down
8 changes: 4 additions & 4 deletions index_ov3660.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ const uint8_t index_ov3660_html[] = R"=====(<!doctype html>
} else if(el.id === "awb_gain"){
value ? show(wb) : hide(wb)
} else if(el.id === "lamp"){
if (value == -1) {
if (value == -1) {
hide(lampGroup)
hide(autolampGroup)
} else {
Expand Down Expand Up @@ -390,7 +390,7 @@ const uint8_t index_ov3660_html[] = R"=====(<!doctype html>
show(streamGroup)
console.log('Stream URL set to: ' + streamURL);
console.log('Stream Viewer URL set to: ' + viewerURL);
}
}
}
}

Expand Down Expand Up @@ -500,7 +500,7 @@ const uint8_t index_ov3660_html[] = R"=====(<!doctype html>
}

// Attach actions to controls

streamLink.onclick = () => {
stopStream();
window.open(viewerURL, "_blank");
Expand Down Expand Up @@ -588,7 +588,7 @@ const uint8_t index_ov3660_html[] = R"=====(<!doctype html>
swapButton.onclick = () => {
window.open('/?view=simple','_self');
}

savePrefsButton.onclick = () => {
if (confirm("Save the current preferences?")) {
updateConfig(savePrefsButton);
Expand Down
2 changes: 1 addition & 1 deletion src/favicons.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ unsigned char favicon_32x32_png[] = {
};
unsigned int favicon_32x32_png_len = 1051;

/* 32x32 .ico format */
/* 32x32 .ico format */

unsigned char favicon_ico[] = {
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x20, 0x20, 0x00, 0x00, 0x01, 0x00,
Expand Down
4 changes: 2 additions & 2 deletions storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern int autoLamp; // Automatic lamp mode
extern int xclk; // Camera module clock speed

/*
* Useful utility when debugging...
* Useful utility when debugging...
*/

void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Expand Down Expand Up @@ -187,7 +187,7 @@ void removePrefs(fs::FS &fs) {
void filesystemStart(){
Serial.println("Starting internal SPIFFS filesystem");
while ( !SPIFFS.begin(FORMAT_SPIFFS_IF_FAILED) ) {
// if we sit in this loop something is wrong;
// if we sit in this loop something is wrong;
// if no existing spiffs partition exists one should be automagically created.
Serial.println("SPIFFS Mount failed, this can happen on first-run initialisation");
Serial.println("If it happens repeatedly check if a SPIFFS partition is present for your board?");
Expand Down

0 comments on commit 322187c

Please sign in to comment.