Greetings,
I am trying to put my HTML code for an ESP8266/Arduino webpage in PROGMEM like this
const char INDEX_HTML[] PROGMEM = R"=====(
<!DOCTYPE HTML lang="en-US">
<html>
<head>
</head>
<body>
<h1>Captive Portal Main Page</h1>
</body>
</html>
)=====";
on top of that i am trying to use condional compilation like this
#define TESTBUTTON
#ifdef TESTBUTTON
// some code here
#endif
i am trying to use the conditional compilation in the webpage like this
const char INDEX_HTML[] PROGMEM = R"=====(
<!DOCTYPE HTML lang="en-US">
<html>
<head>
</head>
<body>
<h1>Captive Portal Main Page</h1>
#ifdef TESTBUTTON
<h2>test</h2>
#endif
</body>
</html>
)=====";
i show the webpage like this
String s = INDEX_HTML;
server.send(200, "text/html", s);
however, when compiling with TESTBUTTON not defined (commented out) the
test
still appears.I am sure it is my (lack of) understanding of PROGMEM that is causing the issue.
If someone knows how to do this, let me know, please
thanks for your time,
Rob