Skip to content

Commit

Permalink
Simple versioning system (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
easytarget authored Oct 12, 2020
1 parent 9045e43 commit 925b8ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app_httpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extern void setLamp(int newVal);
// External variables declared in the main .ino
extern char myName[];
extern char myVer[];
extern char baseVersion[];
extern IPAddress ip;
extern IPAddress net;
extern IPAddress gw;
Expand Down Expand Up @@ -715,8 +716,8 @@ static esp_err_t dump_handler(httpd_req_t *req){
// Module
d+= sprintf(d,"Name: %s<br>\n", myName);
Serial.printf("Name: %s\n", myName);
d+= sprintf(d,"Firmware: %s<br>\n", myVer);
Serial.printf("Firmware: %s\n", myVer);
d+= sprintf(d,"Firmware: %s (base: %s)<br>\n", myVer, baseVersion);
Serial.printf("Firmware: %s (base: %s)\n", myVer, baseVersion);
float sketchPct = 100 * sketchSize / sketchSpace;
d+= sprintf(d,"Sketch Size: %i (total: %i, %.1f%% used)<br>\n", sketchSize, sketchSpace, sketchPct);
Serial.printf("Sketch Size: %i (total: %i, %.1f%% used)\n", sketchSize, sketchSpace, sketchPct);
Expand Down
5 changes: 5 additions & 0 deletions esp32-cam-webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
stationList[] = {{"ESP32-CAM-CONNECT","InsecurePassword", true}};
#endif

// Version string
#include "src/version.h"

// Pin Mappings
#include "camera_pins.h"

Expand Down Expand Up @@ -366,6 +369,8 @@ void setup() {
Serial.println(myName);
Serial.print("Code Built: ");
Serial.println(myVer);
Serial.print("Base Release: ");
Serial.println(baseVersion);

if (stationCount == 0) {
Serial.println("\nFatal Error; Halting");
Expand Down
3 changes: 3 additions & 0 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* Version of upstream code */

char baseVersion[] = "3.0-RC1";

0 comments on commit 925b8ee

Please sign in to comment.