diff --git a/sunny05.ino b/sunny05.ino index 608c4fe..30d0289 100644 --- a/sunny05.ino +++ b/sunny05.ino @@ -87,6 +87,8 @@ const byte PROGMEM stagen[][16] = { }; const byte l_stagen[] = {1,16,16,16,16,8}; +PGM_P s = "

"; + #pragma endregion #define UPDATES_PER_SECOND 100 @@ -270,15 +272,7 @@ void setup() valTime_off.hour = EEPROM.read(2); valTime_off.minute = EEPROM.read(3); valTime_off.second = 0; - int ii = 0; - for (int i = 0; i < 5; i++) - { - ii = isworkday(); - Serial.print(ii); - Serial.print(" "); - delay(500); - } - Serial.println(); + int ii = isworkday(); if(ii != -1) { iswd = ii; @@ -819,9 +813,15 @@ void GP_MY_BLOCK() String s; // s += F(""); // "

"); - s += F("

"); + s += F("

"); + s += F(""); + s += F("

"); GP.SEND(s); } +void GP_MY_BLOCK2() +{ + GP.SEND_P(s); +} void build() { @@ -832,7 +832,7 @@ void build() GP.PAGE_TITLE("Солнышко"); GP.ONLINE_CHECK(); GP.HR(); - GP_MY_BLOCK(); + GP_MY_BLOCK2(); GP.HR(); M_BLOCK( @@ -1037,19 +1037,24 @@ int isworkday() Datime dt = NTP; sprintf(buf, "%04d%02d%02d", dt.year, dt.month, dt.day); String q = "http://isdayoff.ru/" + String(buf); - http.begin(wclient, q.c_str()); - int httpCode = http.GET(); - if (httpCode > 0) + String payload = ""; + do { - String payload = http.getString(); - http.end(); - return payload.toInt(); - } - else - { - http.end(); - return -1; - } + http.begin(wclient, q.c_str()); + int httpCode = http.GET(); + if (httpCode > 0) + { + payload = http.getString(); + http.end(); + // return payload.toInt(); + } + // else + // { + // http.end(); + // return -1; + // } + } while (payload.length() != 1); + return payload.toInt(); } else return -1; // return 1;