Skip to content

Commit 4d64292

Browse files
committed
Merge branch 'master' into ota_commands_in_flash
* master: (37 commits) BREAKING: Change return EEPROM.end() to bool (esp8266#7630) BREAKING: Change return type of channel() (esp8266#7656) BREAKING: Change return type of RSSI() (esp8266#7657) Add Copyright notice to Schedule.h (esp8266#7653) MDNS MultiInterface (esp8266#7636) BREAKING: Add Wrong Password wifi status case (esp8266#7652) New flash writing method with offset/memory/size alignment handling (esp8266#7514) Fix error when debug enabled but no port chosen (esp8266#7648) LEAmDNSv2: change a macro name to be independant from LEAmDNS1 (esp8266#7640) Allow test framework to use cores/esp8266/Arduino.h directly (esp8266#7377) Update OTA HTTP Server Header Information (esp8266#7633) Add missing sntp_init/sntp_stop (esp8266#7628) Use direct member initialization instead of ctr initialisation (esp8266#7558) Prevent rewriting Updater_Signing.h if content unchanged (esp8266#7627) Add WiFi Multi to readme.rst Remove stray axtls refs, deprecated compat funcs (esp8266#7626) Pull deprecated axtls link (esp8266#7624) Redesign ESP8266WiFiMulti.[cpp|h] Update README.md (esp8266#7623) Eliminate code duplication by template for printNumber(...)/printFloat(...). ...
2 parents d616d90 + e79eb11 commit 4d64292

File tree

129 files changed

+14349
-3749
lines changed

Some content is hidden

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

129 files changed

+14349
-3749
lines changed

.github/workflows/pull-request.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ jobs:
154154
mod: 42 # Picked at random to give 4-5 builds and exit.
155155
rem: 13
156156
run: |
157-
sudo apt-get install python3-pip python3-setuptools
157+
sudo apt update
158+
sudo apt install python3-pip python3-setuptools
158159
PATH=/home/runner/.local/bin:$PATH bash ./tests/platformio.sh
159160
160161
@@ -174,7 +175,8 @@ jobs:
174175
TRAVIS_BUILD_DIR: ${{ github.workspace }}
175176
TRAVIS_TAG: ${{ github.ref }}
176177
run: |
177-
sudo apt-get install valgrind lcov
178+
sudo apt update
179+
sudo apt install valgrind lcov
178180
bash ./tests/ci/host_test.sh
179181
180182
@@ -194,7 +196,8 @@ jobs:
194196
TRAVIS_BUILD_DIR: ${{ github.workspace }}
195197
TRAVIS_TAG: ${{ github.ref }}
196198
run: |
197-
sudo apt-get install python3-pip python3-setuptools
199+
sudo apt update
200+
sudo apt install python3-pip python3-setuptools
198201
# GitHub CI installs pip3 and setuptools outside the path.
199202
# Update the path to include them and run.
200203
PATH=/home/runner/.local/bin:$PATH pip3 install --user -r doc/requirements.txt
@@ -217,7 +220,8 @@ jobs:
217220
TRAVIS_BUILD_DIR: ${{ github.workspace }}
218221
TRAVIS_TAG: ${{ github.ref }}
219222
run: |
220-
sudo apt-get install astyle
223+
sudo apt update
224+
sudo apt install astyle
221225
bash ./tests/ci/style_check.sh
222226
223227

README.md

+3-5
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.7.2/)
6+
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.4_a/)
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

@@ -36,7 +36,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
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: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`
3838

39-
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.2/](https://arduino-esp8266.readthedocs.io/en/2.7.2/)
39+
Documentation: [https://arduino-esp8266.readthedocs.io/en/2.7.4_a/](https://arduino-esp8266.readthedocs.io/en/2.7.4_a/)
4040

4141
### Using git version
4242
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino)
@@ -108,7 +108,7 @@ ESP8266 core includes an xtensa gcc toolchain, which is also under GPL.
108108

109109
Esptool.py was initially created by Fredrik Ahlberg (@themadinventor, @kongo), and is currently maintained by Angus Gratton (@projectgus) under GPL 2.0 license.
110110

111-
Espressif SDK included in this build is under Espressif MIT License.
111+
[Espressif's NONOS SDK](https://github.com/espressif/ESP8266_NONOS_SDK) included in this build is under Espressif MIT License.
112112

113113
ESP8266 core files are licensed under LGPL.
114114

@@ -118,8 +118,6 @@ ESP8266 core files are licensed under LGPL.
118118

119119
[SoftwareSerial](https://github.com/plerup/espsoftwareserial) library and examples written by Peter Lerup. Distributed under LGPL 2.1.
120120

121-
[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).
122-
123121
[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).
124122

125123
[LittleFS](https://github.com/ARMmbed/littlefs) library written by ARM Limited and released under the [BSD 3-clause license](https://github.com/ARMmbed/littlefs/blob/master/LICENSE.md).

cores/esp8266/Arduino.h

+28-16
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ extern "C" {
3737
#include "binary.h"
3838
#include "esp8266_peri.h"
3939
#include "twi.h"
40+
4041
#include "core_esp8266_features.h"
4142
#include "core_esp8266_version.h"
4243

@@ -125,15 +126,11 @@ void timer0_isr_init(void);
125126
void timer0_attachInterrupt(timercallback userFunc);
126127
void timer0_detachInterrupt(void);
127128

128-
// Use stdlib abs() and round() to avoid issues with the C++ libraries
129129
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
130130
#define radians(deg) ((deg)*DEG_TO_RAD)
131131
#define degrees(rad) ((rad)*RAD_TO_DEG)
132132
#define sq(x) ((x)*(x))
133133

134-
void ets_intr_lock();
135-
void ets_intr_unlock();
136-
137134
#define interrupts() xt_rsil(0)
138135
#define noInterrupts() xt_rsil(15)
139136

@@ -162,11 +159,12 @@ typedef uint16_t word;
162159
typedef bool boolean;
163160
typedef uint8_t byte;
164161

162+
void ets_intr_lock();
163+
void ets_intr_unlock();
164+
165165
void init(void);
166166
void initVariant(void);
167167

168-
int atexit(void (*func)()) __attribute__((weak));
169-
170168
void pinMode(uint8_t pin, uint8_t mode);
171169
void digitalWrite(uint8_t pin, uint8_t val);
172170
int digitalRead(uint8_t pin);
@@ -212,28 +210,31 @@ void optimistic_yield(uint32_t interval_us);
212210
} // extern "C"
213211
#endif
214212

213+
// undefine stdlib's definitions when encountered, provide abs that supports floating point for C code
214+
#ifndef __cplusplus
215+
#undef abs
216+
#define abs(x) ({ __typeof__(x) _x = (x); _x > 0 ? _x : -_x; })
217+
#undef round
218+
#define round(x) ({ __typeof__(x) _x = (x); _x >= 0 ? (long)(_x + 0.5) : (long)(_x - 0.5); })
219+
#endif // ifndef __cplusplus
215220

216-
221+
// from this point onward, we need to configure the c++ environment
217222
#ifdef __cplusplus
218223

219224
#include <algorithm>
225+
#include <cstdlib>
220226
#include <cmath>
221-
#include <pgmspace.h>
222-
223-
#include "WCharacter.h"
224-
#include "WString.h"
225-
226-
#include "HardwareSerial.h"
227-
#include "Esp.h"
228-
#include "Updater.h"
229-
#include "debug.h"
230227

231228
using std::min;
232229
using std::max;
233230
using std::round;
234231
using std::isinf;
235232
using std::isnan;
236233

234+
// Use float-compatible stl abs() and round(), we don't use Arduino macros to avoid issues with the C++ libraries
235+
using std::abs;
236+
using std::round;
237+
237238
#define _min(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a < _b? _a : _b; })
238239
#define _max(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a > _b? _a : _b; })
239240

@@ -273,8 +274,19 @@ inline void configTzTime(const char* tz, const char* server1,
273274
configTime(tz, server1, server2, server3);
274275
}
275276

277+
// Everything we expect to be implicitly loaded for the sketch
278+
#include <pgmspace.h>
279+
280+
#include "WCharacter.h"
281+
#include "WString.h"
282+
283+
#include "HardwareSerial.h"
284+
#include "Esp.h"
285+
#include "Updater.h"
286+
276287
#endif // __cplusplus
277288

289+
#include "debug.h"
278290
#include "pins_arduino.h"
279291

280292
#endif

0 commit comments

Comments
 (0)