We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e67ebc5 + 916eb89 commit 9e78b6dCopy full SHA for 9e78b6d
cores/esp8266/core_esp8266_features.h
@@ -32,10 +32,11 @@
32
33
#define WIFI_HAS_EVENT_CALLBACK
34
35
-#ifdef __cplusplus
36
-
37
#include <stdlib.h> // malloc()
38
#include <stddef.h> // size_t
+#include <stdint.h>
+
39
+#ifdef __cplusplus
40
41
namespace arduino
42
{
cores/esp8266/core_esp8266_main.cpp
@@ -100,14 +100,15 @@ static void esp_yield_within_cont() {
100
run_scheduled_recurrent_functions();
101
}
102
103
-extern "C" void esp_yield() {
+extern "C" void __esp_yield() {
104
if (can_yield()) {
105
esp_yield_within_cont();
106
107
108
109
-extern "C" void esp_schedule() {
110
- // always on CONT stack here
+extern "C" void esp_yield() __attribute__ ((weak, alias("__esp_yield")));
111
+extern "C" IRAM_ATTR void esp_schedule() {
112
ets_post(LOOP_TASK_PRIORITY, 0, 0);
113
114
libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
@@ -551,7 +551,6 @@ bool HTTPClient::setURL(const String& url)
551
552
// disconnect but preserve _client
553
disconnect(true);
554
- clear();
555
return beginInternal(url, nullptr);
556
557
libraries/ESP8266SSDP/ESP8266SSDP.cpp
@@ -73,7 +73,7 @@ static const char _ssdp_packet_template[] PROGMEM =
73
"SERVER: Arduino/1.0 UPNP/1.1 %s/%s\r\n" // _modelName, _modelNumber
74
"USN: %s\r\n" // _uuid
75
"%s: %s\r\n" // "NT" or "ST", _deviceType
76
- "LOCATION: http://%u.%u.%u.%u:%u/%s\r\n" // WiFi.localIP(), _port, _schemaURL
+ "LOCATION: http://%s:%u/%s\r\n" // WiFi.localIP(), _port, _schemaURL
77
"\r\n";
78
79
static const char _ssdp_schema_template[] PROGMEM =
@@ -88,7 +88,7 @@ static const char _ssdp_schema_template[] PROGMEM =
88
"<major>1</major>"
89
"<minor>0</minor>"
90
"</specVersion>"
91
- "<URLBase>http://%u.%u.%u.%u:%u/</URLBase>" // WiFi.localIP(), _port
+ "<URLBase>http://%s:%u/</URLBase>" // WiFi.localIP(), _port
92
"<device>"
93
"<deviceType>%s</deviceType>"
94
"<friendlyName>%s</friendlyName>"
@@ -247,7 +247,7 @@ void SSDPClass::_send(ssdp_method_t method) {
247
_uuid,
248
(method == NONE) ? "ST" : "NT",
249
(_st_is_uuid) ? _uuid : _deviceType,
250
- ip[0], ip[1], ip[2], ip[3], _port, _schemaURL
+ ip.toString().c_str(), _port, _schemaURL
251
);
252
253
_server->append(buffer, len);
@@ -276,12 +276,12 @@ void SSDPClass::_send(ssdp_method_t method) {
276
_server->send(remoteAddr, remotePort);
277
278
279
-void SSDPClass::schema(WiFiClient client) {
+void SSDPClass::schema(Print &client) const {
280
IPAddress ip = WiFi.localIP();
281
char buffer[strlen_P(_ssdp_schema_template) + 1];
282
strcpy_P(buffer, _ssdp_schema_template);
283
client.printf(buffer,
284
- ip[0], ip[1], ip[2], ip[3], _port,
+ ip.toString().c_str(), _port,
285
_deviceType,
286
_friendlyName,
287
_presentationURL,
libraries/ESP8266SSDP/ESP8266SSDP.h
@@ -62,7 +62,8 @@ class SSDPClass{
62
~SSDPClass();
63
bool begin();
64
void end();
65
- void schema(WiFiClient client);
+ void schema(WiFiClient client) const { schema((Print&)std::ref(client)); }
66
+ void schema(Print &print) const;
67
void setDeviceType(const String& deviceType) { setDeviceType(deviceType.c_str()); }
68
void setDeviceType(const char *deviceType);
69
libraries/ESP8266SdFat
libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -67,6 +67,23 @@ void setup(void) {
server.send(200, "text/plain", "this works as well");
});
70
+ server.on("/gif", []() {
71
+ static const uint8_t gif[] PROGMEM = {
72
+ 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
+ 0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
+ 0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
+ 0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
+ };
+ char gif_colored[sizeof(gif)];
+ memcpy_P(gif_colored, gif, sizeof(gif));
80
+ // Set the background to a random set of colors
81
+ gif_colored[16] = millis() % 256;
82
+ gif_colored[17] = millis() % 256;
83
+ gif_colored[18] = millis() % 256;
84
+ server.send(200, "image/gif", gif_colored, sizeof(gif_colored));
85
+ });
86
87
server.onNotFound(handleNotFound);
server.begin();
libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino
@@ -241,6 +241,7 @@ void printDirectory() {
241
entry.close();
242
243
server.sendContent("]");
244
+ server.sendContent(""); // Terminate the HTTP chunked transmission with a 0-length chunk
245
dir.close();
246
libraries/ESP8266WebServer/src/ESP8266WebServer.h
@@ -127,6 +127,15 @@ class ESP8266WebServerTemplate
127
void send(int code, const char* content_type = NULL, const String& content = String(""));
128
void send(int code, char* content_type, const String& content);
129
void send(int code, const String& content_type, const String& content);
130
+ void send(int code, const char *content_type, const char *content, size_t content_length = 0) {
131
+ if (content_length == 0) {
132
+ content_length = strlen_P(content);
133
+ }
134
+ send_P(code, content_type, content, content_length);
135
136
+ void send(int code, const char *content_type, const uint8_t *content, size_t content_length) {
137
+ send_P(code, content_type, (const char *)content, content_length);
138
139
void send_P(int code, PGM_P content_type, PGM_P content);
140
void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength);
141
libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h
@@ -102,7 +102,7 @@ class StaticRequestHandler : public RequestHandler<ServerType> {
// Append whatever follows this URI in request to get the file path.
path += requestUri.substring(_baseUriLength);
- if (!_fs.exists(path) && path.endsWith(".htm")) {
+ if (!_fs.exists(path) && path.endsWith(".htm") && _fs.exists(path + "l")) {
path += "l";
0 commit comments