Skip to content

Commit

Permalink
Merge branch 'master' into ota_commands_in_flash
Browse files Browse the repository at this point in the history
* 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(...).
  ...
  • Loading branch information
davisonja committed Oct 16, 2020
2 parents d616d90 + e79eb11 commit 4d64292
Show file tree
Hide file tree
Showing 129 changed files with 14,349 additions and 3,749 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ jobs:
mod: 42 # Picked at random to give 4-5 builds and exit.
rem: 13
run: |
sudo apt-get install python3-pip python3-setuptools
sudo apt update
sudo apt install python3-pip python3-setuptools
PATH=/home/runner/.local/bin:$PATH bash ./tests/platformio.sh
Expand All @@ -174,7 +175,8 @@ jobs:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_TAG: ${{ github.ref }}
run: |
sudo apt-get install valgrind lcov
sudo apt update
sudo apt install valgrind lcov
bash ./tests/ci/host_test.sh
Expand All @@ -194,7 +196,8 @@ jobs:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_TAG: ${{ github.ref }}
run: |
sudo apt-get install python3-pip python3-setuptools
sudo apt update
sudo apt install python3-pip python3-setuptools
# GitHub CI installs pip3 and setuptools outside the path.
# Update the path to include them and run.
PATH=/home/runner/.local/bin:$PATH pip3 install --user -r doc/requirements.txt
Expand All @@ -217,7 +220,8 @@ jobs:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
TRAVIS_TAG: ${{ github.ref }}
run: |
sudo apt-get install astyle
sudo apt update
sudo apt install astyle
bash ./tests/ci/style_check.sh
Expand Down
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip

# Quick links

- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.2/)
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.7.4_a/)
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))

Expand Down Expand Up @@ -36,7 +36,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`

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

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

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

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

ESP8266 core files are licensed under LGPL.

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

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

[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).

[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).

[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).
Expand Down
44 changes: 28 additions & 16 deletions cores/esp8266/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern "C" {
#include "binary.h"
#include "esp8266_peri.h"
#include "twi.h"

#include "core_esp8266_features.h"
#include "core_esp8266_version.h"

Expand Down Expand Up @@ -125,15 +126,11 @@ void timer0_isr_init(void);
void timer0_attachInterrupt(timercallback userFunc);
void timer0_detachInterrupt(void);

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

void ets_intr_lock();
void ets_intr_unlock();

#define interrupts() xt_rsil(0)
#define noInterrupts() xt_rsil(15)

Expand Down Expand Up @@ -162,11 +159,12 @@ typedef uint16_t word;
typedef bool boolean;
typedef uint8_t byte;

void ets_intr_lock();
void ets_intr_unlock();

void init(void);
void initVariant(void);

int atexit(void (*func)()) __attribute__((weak));

void pinMode(uint8_t pin, uint8_t mode);
void digitalWrite(uint8_t pin, uint8_t val);
int digitalRead(uint8_t pin);
Expand Down Expand Up @@ -212,28 +210,31 @@ void optimistic_yield(uint32_t interval_us);
} // extern "C"
#endif

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


// from this point onward, we need to configure the c++ environment
#ifdef __cplusplus

#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <pgmspace.h>

#include "WCharacter.h"
#include "WString.h"

#include "HardwareSerial.h"
#include "Esp.h"
#include "Updater.h"
#include "debug.h"

using std::min;
using std::max;
using std::round;
using std::isinf;
using std::isnan;

// Use float-compatible stl abs() and round(), we don't use Arduino macros to avoid issues with the C++ libraries
using std::abs;
using std::round;

#define _min(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a < _b? _a : _b; })
#define _max(a,b) ({ decltype(a) _a = (a); decltype(b) _b = (b); _a > _b? _a : _b; })

Expand Down Expand Up @@ -273,8 +274,19 @@ inline void configTzTime(const char* tz, const char* server1,
configTime(tz, server1, server2, server3);
}

// Everything we expect to be implicitly loaded for the sketch
#include <pgmspace.h>

#include "WCharacter.h"
#include "WString.h"

#include "HardwareSerial.h"
#include "Esp.h"
#include "Updater.h"

#endif // __cplusplus

#include "debug.h"
#include "pins_arduino.h"

#endif
Expand Down
Loading

0 comments on commit 4d64292

Please sign in to comment.