diff --git a/src/html.h b/src/html.h index fae25fb..6d8b085 100644 --- a/src/html.h +++ b/src/html.h @@ -5,8 +5,7 @@ enum parts HTML_BEGIN, HTML_END, STYLE, - SCRIPT_BEGIN, - SCRIPT_END + SCRIPT }; const char html_begin[] PROGMEM = { @@ -54,7 +53,7 @@ const char style[] PROGMEM = { Браузер устарел!\n\ \n"}; -const char script_begin[] PROGMEM = { +const char script[] PROGMEM = { "\n\ "}; -const char script_end[] PROGMEM = {""}; - const char html_end[] PROGMEM = { "
\n\ \n\ @@ -108,11 +105,8 @@ static int getHtml(parts p, char &adr, uint16_t buf_size, uint16_t bias) case STYLE: html_part = style; break; - case SCRIPT_BEGIN: - html_part = script_begin; - break; - case SCRIPT_END: - html_part = script_end; + case SCRIPT: + html_part = script; break; } length = strlen_P(html_part); diff --git a/src/main.cpp b/src/main.cpp index 20c461c..687b237 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,13 +29,7 @@ void handleAccelerometer() bias += getHtml(HTML_BEGIN, *html_code, arr_size, 0); bias += getHtml(STYLE, *html_code, arr_size, bias); - bias += getHtml(SCRIPT_BEGIN, *html_code, arr_size, bias); - // for (int i = 0; i != graphAcc.graphSize - 1; i++) - // { - // bias += snprintf((html_code + bias), arr_size - bias, "context.lineTo(%i*2, %i);\n", i, graphAcc.graphArray[i]); - // } - bias += getHtml(SCRIPT_END, *html_code, arr_size, bias); - //bias += snprintf((html_code+bias), arr_size - bias, "
Current accelerometer: %i", acc); + bias += getHtml(SCRIPT, *html_code, arr_size, bias); bias += getHtml(HTML_END, *html_code, arr_size, bias); server.send(200, "text/html", html_code);