Skip to content

Commit ce148dd

Browse files
Merge branch 'master' of https://github.com/esp8266/Arduino into SDFS
2 parents d215b66 + 7369133 commit ce148dd

File tree

88 files changed

+1744
-1033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1744
-1033
lines changed

README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip
33

44
# Quick links
55

6-
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.5.0-beta2/)
6+
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.5.0/)
77
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
88
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))
99

@@ -28,15 +28,15 @@ ESP8266 Arduino core comes with libraries to communicate over WiFi using TCP and
2828

2929
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).
3030

31-
- Install the current upstream Arduino IDE at the 1.8 level or later. The current version is at the [Arduino website](http://www.arduino.cc/en/main/software).
31+
- Install the current upstream Arduino IDE at the 1.8.7 level or later. The current version is at the [Arduino website](http://www.arduino.cc/en/main/software).
3232
- Start Arduino and open Preferences window.
3333
- Enter ```http://arduino.esp8266.com/stable/package_esp8266com_index.json``` into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
3434
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
3535

3636
#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
3737
Boards manager link: `http://arduino.esp8266.com/stable/package_esp8266com_index.json`
3838

39-
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.5.0-beta2/](https://arduino-esp8266.readthedocs.io/en/2.5.0-beta2/)
39+
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.5.0/](https://arduino-esp8266.readthedocs.io/en/2.5.0/)
4040

4141
### Using git version (basic instructions)
4242
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
@@ -93,21 +93,22 @@ Documentation for latest development version: https://arduino-esp8266.readthedoc
9393

9494
### Issues and support ###
9595

96-
[ESP8266 Community Forum](http://www.esp8266.com/u/arduinoanswers) is a well established community for questions and answers about Arduino for ESP8266.
96+
[ESP8266 Community Forum](http://www.esp8266.com/u/arduinoanswers) is a well established community for questions and answers about Arduino for ESP8266. If you need help, have a "How do I..." type question, have a problem with a 3rd party lib not hosted in this repo, or just want to discuss how to approach a problem , please ask there.
9797

98-
If you find this forum useful, please consider supporting it with a donation. <br />
98+
If you find the forum useful, please consider supporting it with a donation. <br />
9999
[![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
100100

101-
If you encounter an issue which you think is a bug in the ESP8266 Arduino Core or the associated libraries, you are welcome to submit it here on Github: https://github.com/esp8266/Arduino/issues.
101+
If you encounter an issue which you think is a bug in the ESP8266 Arduino Core or the associated libraries, or if you want to propose an enhancement, you are welcome to submit it here on Github: https://github.com/esp8266/Arduino/issues.
102102

103-
Please provide as much context as possible:
103+
Please provide as much context as possible, as well as the information requested in the issue template:
104104

105105
- ESP8266 Arduino core version which you are using (you can check it in Boards Manager)
106106
- your sketch code; please wrap it into a code block, see [Github markdown manual](https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code)
107107
- when encountering an issue which happens at run time, attach serial output. Wrap it into a code block, just like the code.
108108
- for issues which happen at compile time, enable verbose compiler output in the IDE preferences, and attach that output (also inside a code block)
109109
- ESP8266 development board model
110-
- IDE settings (board choich, flash size)
110+
- IDE settings (board choice, flash size)
111+
- etc
111112

112113
### Contributing
113114

@@ -135,6 +136,8 @@ ESP8266 core files are licensed under LGPL.
135136

136137
[umm_malloc](https://github.com/rhempel/umm_malloc) memory management library written by Ralph Hempel is used in this project. It is distributed under MIT license.
137138

139+
[SoftwareSerial](https://github.com/plerup/espsoftwareserial) library and examples written by Peter Lerup. Distributed under LGPL 2.1.
140+
138141
[axTLS](http://axtls.sourceforge.net/) library written by Cameron Rich, built from https://github.com/igrr/axtls-8266, is used in this project. It is distributed under [BSD license](https://github.com/igrr/axtls-8266/blob/master/LICENSE).
139142

140143
[BearSSL](https://bearssl.org) library written by Thomas Pornin, built from https://github.com/earlephilhower/bearssl-esp8266, is used in this project. It is distributed under the [MIT License](https://bearssl.org/#legal-details).

boards.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,8 @@ cw01.upload.resetmethod=nodemcu
13221322
cw01.menu.CrystalFreq.26=26 MHz
13231323
cw01.menu.CrystalFreq.40=40 MHz
13241324
cw01.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
1325-
cw01.build.flash_mode=qio
1326-
cw01.build.flash_flags=-DFLASHMODE_QIO
1325+
cw01.build.flash_mode=dio
1326+
cw01.build.flash_flags=-DFLASHMODE_DIO
13271327
cw01.build.flash_freq=40
13281328
cw01.menu.eesz.4M=4M (no SPIFFS)
13291329
cw01.menu.eesz.4M.build.flash_size=4M

cores/esp8266/AddrList.h

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct netifWrapper
118118
String toString() const { return addr().toString(); }
119119

120120
// related to legacy address (_num=0, ipv4)
121+
IPAddress ipv4 () const { return _netif->ip_addr; }
121122
IPAddress netmask () const { return _netif->netmask; }
122123
IPAddress gw () const { return _netif->gw; }
123124

cores/esp8266/Arduino.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ typedef uint16_t word;
188188
#define bit(b) (1UL << (b))
189189
#define _BV(b) (1UL << (b))
190190

191-
typedef uint8_t boolean;
191+
typedef bool boolean;
192192
typedef uint8_t byte;
193193

194194
void init(void);

cores/esp8266/FS.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,20 @@ File File::openNextFile() {
165165
return _fakeDir->openFile("r");
166166
}
167167

168+
String File::readString()
169+
{
170+
String ret;
171+
ret.reserve(size() - position());
172+
char temp[256+1];
173+
int countRead = readBytes(temp, sizeof(temp)-1);
174+
while (countRead > 0)
175+
{
176+
temp[countRead] = 0;
177+
ret += temp;
178+
countRead = readBytes(temp, sizeof(temp)-1);
179+
}
180+
return ret;
181+
}
168182

169183
File Dir::openFile(const char* mode) {
170184
if (!_impl) {

cores/esp8266/FS.h

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class File : public Stream
8484
void rewindDirectory();
8585
File openNextFile();
8686

87+
String readString() override;
88+
8789
protected:
8890
FileImplPtr _p;
8991

cores/esp8266/StackThunk.c renamed to cores/esp8266/StackThunk.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#include <stdint.h>
2828
#include <stdlib.h>
2929
#include "StackThunk.h"
30+
#include <ets_sys.h>
31+
32+
extern "C" {
3033

3134
uint32_t *stack_thunk_ptr = NULL;
3235
uint32_t *stack_thunk_top = NULL;
@@ -115,8 +118,10 @@ void stack_thunk_dump_stack()
115118
}
116119
ets_printf(">>>stack>>>\n");
117120
while (pos < stack_thunk_ptr) {
118-
ets_printf("%08x: %08x %08x %08x %08x\n", pos, pos[0], pos[1], pos[2], pos[3]);
121+
ets_printf("%08x: %08x %08x %08x %08x\n", (int32_t)pos, pos[0], pos[1], pos[2], pos[3]);
119122
pos += 4;
120123
}
121124
ets_printf("<<<stack<<<\n");
122125
}
126+
127+
};

cores/esp8266/Stream.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class Stream: public Print {
101101
// returns the number of characters placed in the buffer (0 means no valid data found)
102102

103103
// Arduino String functions to be added here
104-
String readString();
104+
virtual String readString();
105105
String readStringUntil(char terminator);
106106

107107
protected:

cores/esp8266/StreamString.cpp

+66-66
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
1-
/**
2-
StreamString.cpp
3-
4-
Copyright (c) 2015 Markus Sattler. All rights reserved.
5-
This file is part of the esp8266 core for Arduino environment.
6-
7-
This library is free software; you can redistribute it and/or
8-
modify it under the terms of the GNU Lesser General Public
9-
License as published by the Free Software Foundation; either
10-
version 2.1 of the License, or (at your option) any later version.
11-
12-
This library is distributed in the hope that it will be useful,
13-
but WITHOUT ANY WARRANTY; without even the implied warranty of
14-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15-
Lesser General Public License for more details.
16-
17-
You should have received a copy of the GNU Lesser General Public
18-
License along with this library; if not, write to the Free Software
19-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20-
21-
*/
22-
23-
#include <Arduino.h>
24-
#include "StreamString.h"
25-
26-
size_t StreamString::write(const uint8_t *data, size_t size) {
27-
if(size && data) {
28-
if(reserve(length() + size + 1)) {
29-
memcpy((void *) (buffer + len), (const void *) data, size);
30-
len += size;
31-
*(buffer + len) = 0x00; // add null for string end
32-
return size;
33-
}
34-
}
35-
return 0;
36-
}
37-
38-
size_t StreamString::write(uint8_t data) {
39-
return concat((char) data);
40-
}
41-
42-
int StreamString::available() {
43-
return length();
44-
}
45-
46-
int StreamString::read() {
47-
if(length()) {
48-
char c = charAt(0);
49-
remove(0, 1);
50-
return c;
51-
52-
}
53-
return -1;
54-
}
55-
56-
int StreamString::peek() {
57-
if(length()) {
58-
char c = charAt(0);
59-
return c;
60-
}
61-
return -1;
62-
}
63-
64-
void StreamString::flush() {
65-
}
66-
1+
/**
2+
StreamString.cpp
3+
4+
Copyright (c) 2015 Markus Sattler. All rights reserved.
5+
This file is part of the esp8266 core for Arduino environment.
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General Public
18+
License along with this library; if not, write to the Free Software
19+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20+
21+
*/
22+
23+
#include <Arduino.h>
24+
#include "StreamString.h"
25+
26+
size_t StreamString::write(const uint8_t *data, size_t size) {
27+
if(size && data) {
28+
if(reserve(length() + size + 1)) {
29+
memcpy((void *) (wbuffer() + len()), (const void *) data, size);
30+
setLen(len() + size);
31+
*(wbuffer() + len()) = 0x00; // add null for string end
32+
return size;
33+
}
34+
}
35+
return 0;
36+
}
37+
38+
size_t StreamString::write(uint8_t data) {
39+
return concat((char) data);
40+
}
41+
42+
int StreamString::available() {
43+
return length();
44+
}
45+
46+
int StreamString::read() {
47+
if(length()) {
48+
char c = charAt(0);
49+
remove(0, 1);
50+
return c;
51+
52+
}
53+
return -1;
54+
}
55+
56+
int StreamString::peek() {
57+
if(length()) {
58+
char c = charAt(0);
59+
return c;
60+
}
61+
return -1;
62+
}
63+
64+
void StreamString::flush() {
65+
}
66+

0 commit comments

Comments
 (0)