Aktualizace na verzi 3.0.6
This commit is contained in:
		@@ -17,7 +17,11 @@ class StreamConcat : public Stream {
 | 
			
		||||
      return c != -1 ? c : _s2->read();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if defined(TARGET_RP2040)
 | 
			
		||||
    size_t readBytes(char* buffer, size_t length) {
 | 
			
		||||
#else
 | 
			
		||||
    size_t readBytes(char* buffer, size_t length) override {
 | 
			
		||||
#endif
 | 
			
		||||
      size_t count = _s1->readBytes(buffer, length);
 | 
			
		||||
      return count > 0 ? count : _s2->readBytes(buffer, length);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,14 @@
 | 
			
		||||
#include <Arduino.h>
 | 
			
		||||
#include <DNSServer.h>
 | 
			
		||||
#ifdef ESP32
 | 
			
		||||
#include <AsyncTCP.h>
 | 
			
		||||
#include <WiFi.h>
 | 
			
		||||
  #include <AsyncTCP.h>
 | 
			
		||||
  #include <WiFi.h>
 | 
			
		||||
#elif defined(ESP8266)
 | 
			
		||||
#include <ESP8266WiFi.h>
 | 
			
		||||
#include <ESPAsyncTCP.h>
 | 
			
		||||
  #include <ESP8266WiFi.h>
 | 
			
		||||
  #include <ESPAsyncTCP.h>
 | 
			
		||||
#elif defined(TARGET_RP2040)
 | 
			
		||||
  #include <WebServer.h>
 | 
			
		||||
  #include <WiFi.h>
 | 
			
		||||
#endif
 | 
			
		||||
#include "StreamConcat.h"
 | 
			
		||||
#include "StreamString.h"
 | 
			
		||||
@@ -42,7 +45,11 @@ void setup() {
 | 
			
		||||
    StreamConcat stream1(&header, &body);
 | 
			
		||||
 | 
			
		||||
    StreamString content;
 | 
			
		||||
#if defined(TARGET_RP2040)
 | 
			
		||||
    content.printf("FreeHeap: %d", rp2040.getFreeHeap());
 | 
			
		||||
#else
 | 
			
		||||
    content.printf("FreeHeap: %" PRIu32, ESP.getFreeHeap());
 | 
			
		||||
#endif
 | 
			
		||||
    StreamConcat stream2 = StreamConcat(&stream1, &content);
 | 
			
		||||
 | 
			
		||||
    File footer = LittleFS.open("/footer.html", "r");
 | 
			
		||||
@@ -67,7 +74,11 @@ void loop() {
 | 
			
		||||
  // dnsServer.processNextRequest();
 | 
			
		||||
 | 
			
		||||
  if (millis() - last > 2000) {
 | 
			
		||||
#if defined(TARGET_RP2040)
 | 
			
		||||
    Serial.printf("FreeHeap: %d", rp2040.getFreeHeap());
 | 
			
		||||
#else
 | 
			
		||||
    Serial.printf("FreeHeap: %" PRIu32, ESP.getFreeHeap());
 | 
			
		||||
#endif
 | 
			
		||||
    last = millis();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -18,7 +18,11 @@ class StreamString : public Stream {
 | 
			
		||||
      return c;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if defined(TARGET_RP2040)
 | 
			
		||||
    size_t readBytes(char* buffer, size_t length) {
 | 
			
		||||
#else
 | 
			
		||||
    size_t readBytes(char* buffer, size_t length) override {
 | 
			
		||||
#endif
 | 
			
		||||
      if (length > _buffer.length())
 | 
			
		||||
        length = _buffer.length();
 | 
			
		||||
      // Don't use _str.ToCharArray() because it inserts a terminator
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user