Skip to content

Commit fd2f7b4

Browse files
committed
Merge branch 'esp8266' into SPIFFS-OTA
2 parents 8cebc1c + 119512d commit fd2f7b4

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

build/build_board_manager_package.sh

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ cp -R ../libraries/SD $outdir/libraries/
1717
cp -R ../libraries/Adafruit_ILI9341 $outdir/libraries/
1818
cp -R ../libraries/OneWire $outdir/libraries/
1919

20+
wget -O SoftwareSerial.zip https://github.com/plerup/espsoftwareserial/archive/38259afcab9c291dbb6216f827d9a3738abf1868.zip
21+
unzip SoftwareSerial.zip
22+
rm -rf SoftwareSerial.zip
23+
mv espsoftwareserial-* SoftwareSerial
24+
mv SoftwareSerial $outdir/libraries
25+
2026
cat $srcdir/platform.txt | \
2127
gsed 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \
2228
gsed 's/runtime.tools.esptool.path={runtime.platform.path}\/tools//g' | \

hardware/esp8266com/esp8266/doc/reference.md

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ title: Reference
3131
* [EEPROM](#eeprom)
3232
* [I2C (Wire library)](#i2c-wire-library)
3333
* [SPI](#spi)
34+
* [SoftwareSerial](#softwareserial)
3435
* [ESP-specific APIs](#esp-specific-apis)
3536
* [OneWire (from <a href="https://www.pjrc.com/teensy/td_libs_OneWire.html">https://www.pjrc.com/teensy/td_libs_OneWire.html</a>)](#onewire-from-httpswwwpjrccomteensytd_libs_onewirehtml)
3637
* [mDNS and DNS-SD responder (ESP8266mDNS library)](#mdns-and-dns-sd-responder-esp8266mdns-library)
@@ -398,6 +399,10 @@ else they default to pins 4(SDA) and 5(SCL).
398399
SPI library supports the entire Arduino SPI API including transactions, including setting phase (CPHA).
399400
Setting the Clock polarity (CPOL) is not supported, yet (SPI_MODE2 and SPI_MODE3 not working).
400401

402+
## SoftwareSerial
403+
404+
An ESP8266 port of SoftwareSerial library done by Peter Lerup (@plerup) supports baud rate up to 115200 and multiples SoftwareSerial instances. See the https://github.com/plerup/espsoftwareserial if you want to suggest an improvement or open an issue related to SoftwareSerial.
405+
401406
## ESP-specific APIs
402407

403408
APIs related to deep sleep and watchdog timer are available in the `ESP` object, only available in Alpha version.

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h

+13-18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
1+
/*
22
ClientContext.h - TCP connection handling on top of lwIP
33
44
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
55
This file is part of the esp8266 core for Arduino environment.
6-
6+
77
This library is free software; you can redistribute it and/or
88
modify it under the terms of the GNU Lesser General Public
99
License as published by the Free Software Foundation; either
@@ -39,7 +39,7 @@ class ClientContext {
3939
tcp_sent(pcb, &_s_sent);
4040
tcp_err(pcb, &_s_error);
4141
}
42-
42+
4343
err_t abort(){
4444
if(_pcb) {
4545
DEBUGV(":abort\r\n");
@@ -52,7 +52,7 @@ class ClientContext {
5252
}
5353
return ERR_ABRT;
5454
}
55-
55+
5656
err_t close(){
5757
err_t err = ERR_OK;
5858
if(_pcb) {
@@ -71,7 +71,7 @@ class ClientContext {
7171
}
7272
return err;
7373
}
74-
74+
7575
~ClientContext() {
7676
}
7777

@@ -101,18 +101,18 @@ class ClientContext {
101101
}
102102
}
103103
}
104-
104+
105105
void setNoDelay(bool nodelay){
106106
if(!_pcb) return;
107107
if(nodelay) tcp_nagle_disable(_pcb);
108108
else tcp_nagle_enable(_pcb);
109109
}
110-
110+
111111
bool getNoDelay(){
112112
if(!_pcb) return false;
113113
return tcp_nagle_disabled(_pcb);
114114
}
115-
115+
116116
uint32_t getRemoteAddress() {
117117
if(!_pcb) return 0;
118118

@@ -277,16 +277,11 @@ class ClientContext {
277277

278278
void _error(err_t err) {
279279
DEBUGV(":er %d %d %d\r\n", err, _size_sent, _send_waiting);
280-
if (err != ERR_ABRT) {
281-
abort();
282-
}
283-
else {
284-
tcp_arg(_pcb, NULL);
285-
tcp_sent(_pcb, NULL);
286-
tcp_recv(_pcb, NULL);
287-
tcp_err(_pcb, NULL);
288-
_pcb = NULL;
289-
}
280+
tcp_arg(_pcb, NULL);
281+
tcp_sent(_pcb, NULL);
282+
tcp_recv(_pcb, NULL);
283+
tcp_err(_pcb, NULL);
284+
_pcb = NULL;
290285
if(_size_sent && _send_waiting) {
291286
esp_schedule();
292287
}

0 commit comments

Comments
 (0)