1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

4405 Commits

Author SHA1 Message Date
hreintke
be812d2a8d
Netump Initial commit (#7527) 2020-08-30 13:07:52 -07:00
Earle F. Philhower, III
247d5f1218
Merge branch 'master' into stdnothrow 2020-08-30 12:39:55 -07:00
Valerii Koval
b9db9440fe
Delete owner field (#7563) 2020-08-30 00:10:45 +03:00
Dirk Mueller
953dfd945f
Avoid float-double-conversion (#7559)
Converting floats to doubles is very expensive on esp8266, so prefer
calculations or comparisons as float. This saves 10% (20 bytes) of the
String::parseFloat() code size and probably quite a bit of runtime
overhead.
2020-08-28 17:09:44 -04:00
Dirk Mueller
59873908c4
Use direct member initialization instead of ctr initialisation (#7556)
This removes a bit of code repetition.
2020-08-28 10:23:05 -04:00
Earle F. Philhower, III
c366f84520
Add CI test for eboot build (#7546)
Check that building the eboot.c block generates the same binary as
the verison checked into the repo.  Catches the case where a library
or eboot.c file is changed, but an updated eboot.elf isn't included
in a PR.

Can't do simple binary diff of the ELFs because paths and compile
times will change, so dump the two sections we care about.
2020-08-27 18:32:58 -07:00
david gauchard
53e4dec51f
getCpuFreqMHz(): fix when F_CPU is not defined (#7554) 2020-08-27 21:56:03 +02:00
david gauchard
e53aa87160
emulation-on-host makefile update, allowing to pass more options (#7552) 2020-08-26 15:40:54 +02:00
5chufti
83535a01d2
add sdk options to "generic esp8285 module" (#7550)
* add sdk options to "generic esp8255 module"
upgrade esp8285 variant to full generic device
2020-08-25 16:14:14 +02:00
david gauchard
3ee6710fa5 board generator: remove comments, remove now useless define 2020-08-25 11:04:30 +02:00
david gauchard
f23e765ab1 fix displaying caller address 2020-08-25 11:00:48 +02:00
david gauchard
c111713208 overwrite weak new (std::nothrow) calls 2020-08-24 22:42:29 +02:00
david gauchard
2b6423edcc new w/ OOM raises an exception, shows the caller address for decoders 2020-08-24 22:15:33 +02:00
david gauchard
11f7d1766e remove (std::nothrow) where nullptr case is not handled
remove legacy new management
2020-08-24 09:51:58 +02:00
Earle F. Philhower, III
cf1b8e067a Don't overwrite boot sector unless OTA changes it
There is a window where the eboot sector is erased and
unwritten/partially written.  If there's a power cycle at this time, the
chip will brick due to eboot being corrupted.

Avoid this by checking if the new eboot 4K sector is identical to the
one already in flash, and if so don't rewrite it.
2020-08-23 19:33:58 -07:00
david gauchard
a16e1e5b8a fixes 2020-08-23 19:43:32 +02:00
david gauchard
f23caa2dcd Merge branch 'master' into stdnothrow 2020-08-23 19:28:21 +02:00
standby24x7
1ff927d04c
Fix spelling typo under doc/faq (#7538)
This patch fixes some spelling typo found in doc/faq.
2020-08-18 07:45:37 -07:00
Cristian Popescu
c33a6a261d
Updater MD5 cleanup on begin (#7534)
Co-authored-by: Cristian Popescu <cristian.popescu@esolutions.ro>
2020-08-17 17:26:22 -07:00
david gauchard
385bfd7635 deleted: arduino_new/arduino_new.ino 2020-08-17 18:23:44 +02:00
david gauchard
6925982284 replace new by new (std::nothrow), remove arduino_new 2020-08-17 18:15:45 +02:00
Earle F. Philhower, III
5b3d290de8
Add synthetic IntegerDivideByZero exception (#7496)
The ROM routine __divsi3 is called by code whenever a division is needed,
because there is no divide unit on the ESP8266 core.  When the divide
routine in ROM hits a div-by-zero case, it jumpt to an ILL(egal instruction)
at a fixed address which causes a HW exception 0 (IllegalInsnException).

In the postmortem dump, when an ILL exception is detected at this address
in ROM, convert it to a DivByZeroException for printout (6).

Divde by zero errors now print as follows:
````
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Exception (6):
epc1=0x4000dce5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>
...
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
````

And will decode as follows:
````
Exception 6: IntegerDivideByZero: QUOS, QUOU, REMS, or REMU divisor operand is zero
PC: 0x4000dce5
EXCVADDR: 0x00000000

Decoding stack results
...
````
2020-08-16 17:50:17 -07:00
david gauchard
f42327da34
doc: gcc handles duplicate literal strings (#7531) 2020-08-16 17:43:15 -07:00
Earle F. Philhower, III
e2b8f6acfb
Update PIO CI to be less chatty, fix CI fail (#7530)
Remove get.py percent dump to shorten PIO output 99%.

Use latest release version of PIO, not bleeding edge, to fix
failures introduced in devel (non-release) PIO versions.
Thanks, @mcspr, for noticing this!
2020-08-16 11:41:42 -07:00
david gauchard
e0fedc577b
avoid circular #include dependence for PolledTimeout (#7356)
* move features to features.h

* fix std:: dependencies

* fix emulation on host

* api explanation
2020-08-15 15:24:35 -04:00
Develo
01edc0e51f
Fix and add details to Serial doc (#7521)
Fixes #7484

Clarify blocking case for write()

Add flush() method.

Missing ), clarifications
2020-08-13 16:41:57 -04:00
standby24x7
683b8e606c
Fix spelling typos in files under doc/esp8266wifi (#7520)
This patch fixes some spelling typos in following files
bearssl-client-secure-class.rst
client-class.rst
scan-class.rst
scan-examples.rst
server-examples.rst
2020-08-12 08:28:22 -07:00
david gauchard
6feda9ebda
base64 class uses String, adding harmless #include (#7517) 2020-08-11 14:30:39 +02:00
david gauchard
777323709b
webserver: add define WEBSERVER_HAS_HOOK when ::addHook() is present (#7515)
This allows conditional compilation for external libraries
2020-08-11 02:15:46 +02:00
Takayuki 'January June' Suwa
fc2426a5e9
sys/pgmspace.h: Refactor inline asm (#7510)
* Refactor asm tabs for `.S` cosmetics

* Avoid fixed regname (`a14`) allocation

* Remove unnecessary explicit cast and word masking
2020-08-08 17:29:30 -07:00
david gauchard
79fc0b3b4a
CI: on host: force 64 bit mode like make -j2 CI implicitly does (#7513)
It allows to run CI tests on computers having gcc-multilib installed
2020-08-07 17:17:29 +02:00
Earle F. Philhower, III
3e567e9489
Add SerialEvent() callback to loop processing (#7505)
* Add SerialEvent() callback to loop processing

Match the AVR SerialEvent implicit callback.  Callback is executed
in normal user mode, not IRQ, so standard processing can be uses.

Fixes #752 after 5 years. :)

* Fix style
2020-08-05 20:13:37 -04:00
Earle F. Philhower, III
9afb084159
Clean up minor warnings from LGTM.com (#7500)
* Clean up minor warnings from LGTM.com

LGTM (Semmie) is a tool, bought by GitHub last year, that conducts basic
linting tasks on code and HTML.

Clean up the warnings identified in the latest report:
https://lgtm.com/projects/g/esp8266/Arduino/?mode=list

No functionality should change, however this may fix some issues with
the perl utilities not exiting properly on a Ctrl-C from the command
line.

* Back out HTML changes and rerun boards.txt.py
2020-08-03 19:19:04 -07:00
Earle F. Philhower, III
a8e35a579c
Add valgrind mocked test to CI (#7501)
Run valgrind on host mock example runs to catch more bugs in CI.  These
tests would have caught the problem in #7464 before users did.

Add a list of some randomly picked examples to run, and add an option to
run the loop exactly once in the host mock routine, so the test will
actually exit under valgrind.
2020-08-03 19:00:51 -07:00
Earle F. Philhower, III
fc1aa554cd
Remove warnings when buinding NoAssert (#7499)
Parameters that are only used in an assert() statement are unused when
the NoAssert-NDEBUG option is used.  This causes the following unused
parameter warnings while building:

````
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp: In function 'String {anonymous}::createBearsslHmac(const br_hash_class*, uint8_t, const String&, const void*, size_t, size_t)':
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp:101:71: warning: unused parameter 'hashTypeNaturalLength' [-Wunused-parameter]
  101 | String createBearsslHmac(const br_hash_class *hashType, const uint8_t hashTypeNaturalLength, const String &message, const void *hashKey, const size_t hashKeyLength, const size_t hmacLength)
      |                                                         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp: In function 'String {anonymous}::createBearsslHmacCT(const br_hash_class*, uint8_t, const String&, const void*, size_t, size_t)':
/home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/Crypto.cpp:153:73: warning: unused parameter 'hashTypeNaturalLength' [-Wunused-parameter]
  153 | String createBearsslHmacCT(const br_hash_class *hashType, const uint8_t hashTypeNaturalLength, const String &message, const void *hashKey, const size_t hashKeyLength, const size_t hmacLength)
      |                                                           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
````

Mark them unused in the code to avoid the error.  The assert() still
works.
2020-08-03 18:03:23 -07:00
Peter
3be0cbb385
Typo (#7502) 2020-08-03 07:42:22 -07:00
drhideg
d92e1edac8
Basic authentication with ESP8266httpUpdate (#7190)
Add ability to use basic access authentication with ESP8266httpUpdate
2020-07-30 08:55:29 -07:00
Drzony
85ea47e9bc
Fixed PUYA flash write buffer alignment (#7491)
* Fixed PUYA flash write buffer alignment (round up)
2020-07-30 11:03:49 -04:00
david gauchard
1041a9d752
webhook/http1.1: prevent from losing a new client while waiting (#7492) 2020-07-30 01:26:56 +02:00
Peter
d5187790bd
Mention OTA Update class blocks flash mode changes (#7321)
Add mention that OTA Update class will block changes to flash mode bits if the image is uncompressed, and link to the recent discussion on this.

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-07-29 11:37:32 -04:00
Earle F. Philhower, III
a679869155
BREAKING - analogWriteRange 8-bit default (#7456)
Matching standard Arduino cores, make the default analogWrite() take
values from 0...255.  Users can always use the analogWriteRange() call
to change to a different setup.

Add a `analogWriteResolution` which takes a number of bits and sets
the range from 0...(1<<bits)-1, part of the standard Arduino API.

Remove the PWMRANGE define.  It's non-standard and not generally valid
(i.e. it's fixed at 1024 of 256, but the real range varies depending on
what you last set).

Also add note about the change and how to fix pre 3.0 applications.

Fixes #2895
2020-07-28 17:39:38 -07:00
david gauchard
33083861c8
webserver hook: allow to handle external http protocol (#7459)
* webhook api
* simplify webserver debug printouts, move text to flash
* Hook examples in HelloServer example
* print executable code address in example
* simplify example per @mcspr suggestion
2020-07-28 23:34:26 +02:00
Earle F. Philhower, III
63b41bcfab
Use root cert, not fingerprint for api.github.com (#7490)
In the HTTPS example we were using a fingerprint which changes almost
daily as the github.com certificates are regenerated.  Replace this with
a trust anchor based on the ultimate root CA that github.com uses to
sign their certificates.  Assuming they don't change CAs, this
certificate should be good until 2030+

Fixes #7489
2020-07-28 12:11:00 -07:00
Earle F. Philhower, III
355b291614
CVE-2020-12638 workaround for WPA downgrade attack (#7486)
* CVE-2020-12638 workaround for WPA downgrade attack

When connected to an encrypted (WEP/WPA) router, a rogue packet can
cause the ESP8266 WiFi stack to drop to an unecrypted rogue network of
the same SSID.

Handle this by dropping the WiFi connection immediately and reconnecting
to the stored WPA/WEP network requested by the application, whenever the
AUTHMODE changes to OPEN from a secured mode.

https://lbsfilm.at/blog/wpa2-authenticationmode-downgrade-in-espressif-microprocessors
for more details.
2020-07-26 10:11:14 -07:00
M Hightower
e815b9219b
Correct stack string buffer length. (#7488)
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-07-26 10:01:21 -07:00
Jorg Neves Bliesener
0e12906950
Initialize _ledPin (#7487)
* Initialize _ledPin

_ledPin should be initialized to -1 in the constructor to avoid setting a random pin when calling Updater::end without having called Updater::begin before. This happens, for example, in the Homie software

* Fix field sequence
2020-07-26 12:39:55 -04:00
david gauchard
83fc47f6d9
Small update to ease manual release generation (#7467) 2020-07-22 22:34:21 -07:00
Earle F. Philhower, III
555c9ebdf8
Update FP for tls.mbed.org (#7479) 2020-07-22 22:26:00 -07:00
Earle F. Philhower, III
f42cf7a5a4
Fix uninitted class variables from #7464 (#7478)
PR #7464 removed the reset of client authentication settings when server
authentication settings were changed, however it never did initialize
the client authentication information to nullptr in the constructor.
This can result in crashes during connections when client certs are not
applied.

Fix by resetting the client authenticaion variables on object
construction.
2020-07-22 22:10:44 -07:00
Develo
c94d36d80e
Comment out verify step in eboot.c (#7468)
* Comment out verify step in eboot.c

Meant for #7458 , but still requires a recompiled eboot.elf.

* Rebuild eboot.elf from changed source

Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
2020-07-20 23:24:51 -04:00