Skip to content

Commit 2c74cdb

Browse files
authored
Merge branch 'master' into constcharweb
2 parents c320ab8 + 919c753 commit 2c74cdb

File tree

10 files changed

+28
-25
lines changed

10 files changed

+28
-25
lines changed

cores/esp8266/core_esp8266_features.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@
3232

3333
#define WIFI_HAS_EVENT_CALLBACK
3434

35-
#ifdef __cplusplus
36-
3735
#include <stdlib.h> // malloc()
3836
#include <stddef.h> // size_t
37+
#include <stdint.h>
38+
39+
#ifdef __cplusplus
3940

4041
namespace arduino
4142
{

cores/esp8266/core_esp8266_main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,14 @@ static void esp_yield_within_cont() {
100100
run_scheduled_recurrent_functions();
101101
}
102102

103-
extern "C" void esp_yield() {
103+
extern "C" void __esp_yield() {
104104
if (can_yield()) {
105105
esp_yield_within_cont();
106106
}
107107
}
108108

109+
extern "C" void esp_yield() __attribute__ ((weak, alias("__esp_yield")));
110+
109111
extern "C" void esp_schedule() {
110112
// always on CONT stack here
111113
ets_post(LOOP_TASK_PRIORITY, 0, 0);

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ bool HTTPClient::setURL(const String& url)
551551
}
552552
// disconnect but preserve _client
553553
disconnect(true);
554-
clear();
555554
return beginInternal(url, nullptr);
556555
}
557556

libraries/ESP8266SSDP/ESP8266SSDP.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static const char _ssdp_packet_template[] PROGMEM =
7373
"SERVER: Arduino/1.0 UPNP/1.1 %s/%s\r\n" // _modelName, _modelNumber
7474
"USN: %s\r\n" // _uuid
7575
"%s: %s\r\n" // "NT" or "ST", _deviceType
76-
"LOCATION: http://%u.%u.%u.%u:%u/%s\r\n" // WiFi.localIP(), _port, _schemaURL
76+
"LOCATION: http://%s:%u/%s\r\n" // WiFi.localIP(), _port, _schemaURL
7777
"\r\n";
7878

7979
static const char _ssdp_schema_template[] PROGMEM =
@@ -88,7 +88,7 @@ static const char _ssdp_schema_template[] PROGMEM =
8888
"<major>1</major>"
8989
"<minor>0</minor>"
9090
"</specVersion>"
91-
"<URLBase>http://%u.%u.%u.%u:%u/</URLBase>" // WiFi.localIP(), _port
91+
"<URLBase>http://%s:%u/</URLBase>" // WiFi.localIP(), _port
9292
"<device>"
9393
"<deviceType>%s</deviceType>"
9494
"<friendlyName>%s</friendlyName>"
@@ -247,7 +247,7 @@ void SSDPClass::_send(ssdp_method_t method) {
247247
_uuid,
248248
(method == NONE) ? "ST" : "NT",
249249
(_st_is_uuid) ? _uuid : _deviceType,
250-
ip[0], ip[1], ip[2], ip[3], _port, _schemaURL
250+
ip.toString().c_str(), _port, _schemaURL
251251
);
252252

253253
_server->append(buffer, len);
@@ -276,12 +276,12 @@ void SSDPClass::_send(ssdp_method_t method) {
276276
_server->send(remoteAddr, remotePort);
277277
}
278278

279-
void SSDPClass::schema(WiFiClient client) {
279+
void SSDPClass::schema(Print &client) const {
280280
IPAddress ip = WiFi.localIP();
281281
char buffer[strlen_P(_ssdp_schema_template) + 1];
282282
strcpy_P(buffer, _ssdp_schema_template);
283283
client.printf(buffer,
284-
ip[0], ip[1], ip[2], ip[3], _port,
284+
ip.toString().c_str(), _port,
285285
_deviceType,
286286
_friendlyName,
287287
_presentationURL,

libraries/ESP8266SSDP/ESP8266SSDP.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class SSDPClass{
6262
~SSDPClass();
6363
bool begin();
6464
void end();
65-
void schema(WiFiClient client);
65+
void schema(WiFiClient client) const { schema((Print&)std::ref(client)); }
66+
void schema(Print &print) const;
6667
void setDeviceType(const String& deviceType) { setDeviceType(deviceType.c_str()); }
6768
void setDeviceType(const char *deviceType);
6869

libraries/ESP8266WebServer/examples/SDWebServer/SDWebServer.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ void printDirectory() {
241241
entry.close();
242242
}
243243
server.sendContent("]");
244+
server.sendContent(""); // Terminate the HTTP chunked transmission with a 0-length chunk
244245
dir.close();
245246
}
246247

libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class StaticRequestHandler : public RequestHandler<ServerType> {
102102
// Append whatever follows this URI in request to get the file path.
103103
path += requestUri.substring(_baseUriLength);
104104

105-
if (!_fs.exists(path) && path.endsWith(".htm")) {
105+
if (!_fs.exists(path) && path.endsWith(".htm") && _fs.exists(path + "l")) {
106106
path += "l";
107107
}
108108
}

libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ bool ESP8266WiFiGenericClass::mode(WiFiMode_t m, WiFiState* state) {
443443
//tasks to wait correctly.
444444
constexpr unsigned int timeoutValue = 1000; //1 second
445445
if(can_yield()) {
446-
using oneShot = esp8266::polledTimeout::oneShotFastUs;
446+
using oneShot = esp8266::polledTimeout::oneShotFastMs;
447447
oneShot timeout(timeoutValue);
448448
while(wifi_get_opmode() != (uint8) m && !timeout)
449449
delay(5);

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ tools.esptool.upload.params.quiet=
149149
# First, potentially perform an erase or nothing
150150
# Next, do the binary upload
151151
# Combined in one rule because Arduino doesn't suport upload.1.pattern/upload.3.pattern
152-
tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} {upload.resetmethod} "{build.path}/{build.project_name}.bin"
152+
tools.esptool.upload.pattern="{cmd}" "{runtime.platform.path}/tools/upload.py" --chip esp8266 --port "{serial.port}" --baud "{upload.speed}" "{upload.verbose}" {upload.erase_cmd} {upload.resetmethod} write_flash 0x0 "{build.path}/{build.project_name}.bin"
153153

154154
tools.esptool.upload.network_pattern="{network_cmd}" "{runtime.platform.path}/tools/espota.py" -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
155155

tools/upload.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
cmdline = []
2424
write_option = ''
25+
write_addr = '0x0'
2526
erase_addr = ''
2627
erase_len = ''
2728

@@ -38,28 +39,26 @@
3839
# https://github.com/esp8266/Arduino/issues/6755#issuecomment-553208688
3940
if thisarg == "erase_flash":
4041
write_option = '--erase-all'
41-
thisarg = ''
42-
43-
if thisarg == 'erase_region':
42+
elif thisarg == 'erase_region':
4443
erase_addr = sys.argv.pop(0)
4544
erase_len = sys.argv.pop(0)
46-
thisarg = ''
47-
48-
if os.path.isfile(thisarg):
49-
binary = thisarg
50-
thisarg = ''
51-
52-
if len(thisarg):
45+
elif thisarg == '--end':
46+
# Backwards compatibility with fs upload tools, eat --end
47+
pass
48+
elif thisarg == 'write_flash':
49+
write_addr = sys.argv.pop(0)
50+
binary = sys.argv.pop(0)
51+
elif len(thisarg):
5352
cmdline = cmdline + [thisarg]
5453

5554
cmdline = cmdline + ['write_flash']
5655
if len(write_option):
5756
cmdline = cmdline + [write_option]
58-
cmdline = cmdline + ['0x0', binary]
57+
cmdline = cmdline + [write_addr, binary]
5958

6059
erase_file = ''
6160
if len(erase_addr):
62-
# generate temporary empty (0xff) file
61+
# Generate temporary empty (0xff) file
6362
eraser = tempfile.mkstemp()
6463
erase_file = eraser[1]
6564
os.write(eraser[0], bytearray([255] * int(erase_len, 0)))

0 commit comments

Comments
 (0)