From 03ce0ee0393567aebf1674df69d230c3af496205 Mon Sep 17 00:00:00 2001 From: Nikita Romanenko Date: Wed, 13 Dec 2017 19:20:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D1=83=20=D0=BE=D0=B1=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D0=BD=D0=BE=D1=81=D1=82=D1=8C=D1=8E.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/html.h | 14 ++++---------- src/main.cpp | 8 +------- 2 files changed, 5 insertions(+), 17 deletions(-) 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);