Skip to content

Commit

Permalink
web_page string to be passesd by referance
Browse files Browse the repository at this point in the history
  • Loading branch information
say-paul committed Mar 21, 2024
1 parent 42c392a commit b25d244
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/blite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ int Blite::readADC(){
return analogRead(ADC1);
}

void Blite::setupServer(String HTML_CONTENT) {
void Blite::setupServer(String &html_content) {
this->webServer.on("/", HTTP_GET, [=]() {
this->webServer.send(200, "text/html", HTML_CONTENT);
this->webServer.send(200, "text/html", html_content);
});
this->webServer.begin();
this->serverSetupDone = true;
Expand All @@ -142,9 +142,9 @@ void Blite::renderServer() {
this->otaLoop();
}

void Blite::smartRenderServer(String HTML_CONTENT){
void Blite::smartRenderServer(String &html_content){
if (!this->serverSetupDone) {
this->setupServer(HTML_CONTENT);
this->setupServer(html_content);
}
this->renderServer();
}
Expand Down
4 changes: 2 additions & 2 deletions src/blite.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ bool buttonPressed();
void blinkLed(int c);
int readADC();

void setupServer(String HTML_CONTENT);
void setupServer(String &html_content);
void renderServer();
void smartRenderServer(String HTML_CONTENT);
void smartRenderServer(String &html_content);

void otaSetup();
void otaLoop();
Expand Down

0 comments on commit b25d244

Please sign in to comment.