1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00
Commit Graph

3933 Commits

Author SHA1 Message Date
27da34760b At MDNS.end() also release services (#7859) 2021-02-04 14:46:13 +01:00
20413f817b Update toolchain to support std::remainder (#7849)
Update newlib to enable the __ieee754_remainder(f) calls required by
std::remainder and others.

Add device test for std::remainder variants.

Fixes #7845
2021-01-29 12:30:42 -08:00
39d14530ff Add a check for all URLs in the package file (#7848)
Avoid issues like #7847 by downloading and checking SHA for each file in
the package.json bundle.
2021-01-28 08:56:45 -08:00
600c5d7c0b Fix typo in 32-bit Windows package JSON (#7847)
Fatfingered the 32-bit Windows pointer to the Python interpreter.  Our
CI and my own testing missed due to being on 64-bit Windows.

For 2.7.4 release, I'll add a file of the appropriate name to the
release for now, but this will correct things for 3.0.0 and forward.
2021-01-28 08:08:03 -08:00
c2393d05be Fix improper GENERIC board IDs (#7839)
A couple board types reported ESP8266_GENERIC instead of their proper
types in boards.txt (and in defined generated therefrom/etc.).

Give them proper board types based on their names, like other modules.
2021-01-27 00:06:12 -08:00
f2d83ba43d allow to set pin to OUTPUT_OPEN_DRAIN in analogWriteMode (#7841)
* allow to set pin to OUTPUT_OPEN_DRAIN in analogWrite

* remove parameter with default value

* Update core_esp8266_wiring_pwm.cpp

* update documentation accordingly
2021-01-26 23:56:43 -08:00
53e5688453 Update to EspSoftwareSerial 6.11.3: prepares for ESP8266 Arduino core PR 6979. (#7840) 2021-01-26 01:03:56 +01:00
349e67f7f5 Fix I2S reported rate for 24b mode (#7838)
Adjust the number of bittimes when returning the real I2S rate.
2021-01-24 09:59:20 -08:00
f0e8f8eac4 Update eboot to build with C17, not C99 standard (#7837)
No functional change.  Make the main core and eboot build using the
same C standard version (gnu17).
2021-01-23 16:24:15 -08:00
e0cfb5a995 Add 24-bit mode to I2S (#7835)
Add basic 24 bit mode to the I2S API with a i2s_set_bits() call.
By default 16b mode is still used, but if i2s_set_bits(24) is run
before i2s_begin() then the HW will drive 24-bits of data.  This
data must be left-aligned (i.e. bits 31..8) in 4-byte samples.

Fixes #5244 (the HW doesn't support 8 or 32 bits, only 16 or 24).
2021-01-23 14:40:29 -08:00
b3fe0aab19 Hexdump fix&update (#7831)
* hexdump() must be "C"; add ascii data in dump
* remove previous version
2021-01-22 23:04:22 +01:00
11a2fb3872 Dynamically configure exceptions support (#7834) 2021-01-22 17:08:45 +02:00
2402958208 Merge pull request #7629 from Erriez/feature/issue-2246-multi-wifi-hidden
Add support for hidden SSID's Multi WiFi
2021-01-21 01:11:21 -03:00
d90015e326 Merge branch 'master' into feature/issue-2246-multi-wifi-hidden 2021-01-19 16:12:54 +01:00
85e2ffffe1 Allow users to inherit and override CertStore (#7827)
Make installCertStore virtual so we can inherit from CertStore and override it
Create CertStoreBase to inherit from
2021-01-18 11:59:20 -08:00
f5fd5912fe Allow specifying waveform generator in source code (#7800)
* Allow specifying waveform generator in source code

Allows code to explicitly specify which waveform generator it wants,
without needing to use one of the 100 IDE menus or adding a `-D`
compile-time define.

Uses weakrefs to allow for apps to call `enablePhaseLockedWaveform();`
within their `setup()` (or anywhere, really) and have the phase locked
versions override the default waveform generators automatically.

For example:

````
void setup() {
  // Uncomment following line to use phase-locked waveform generator
  // enablePhaseLockedWaveform();
  Serial.begin(115200);
  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
  analogWriteRange(1000);
}
void loop() {
  analogWrite(LED_BUILTIN, 100);
  delay(1000);                      // Wait for a second
  analogWrite(LED_BUILTIN, 900);
  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
}
````

Also adds an example showing it's use.

Address @dok-net's comments and also remove the _weak/_bound version of
startWaveform() since it's invariant of the actual waveform generator.
2021-01-17 15:57:26 -08:00
a4b6003c2e Replacement for Boot ROM aes_unwrap (#7773)
* Replacement for Boot ROM aes_unwrap

* Removed unnecessary test
2021-01-13 15:43:55 -08:00
dbc5e4164c Supersede #3856, remove undef min/max (#7824)
Remove a straggler `undef min/max` from core header
Supersedes #3856
2021-01-12 17:58:04 -08:00
df5e113b88 HeapSelectDram for pvPortMalloc, ... (#7790)
* Add inline always option to HeapSelect

* Add option to force DRAM for pvPort... APIs

* revert print_loc premature change

* Renamed macro to be more specific, FORCE_ALWAYS_INLINE to FORCE_ALWAYS_INLINE_HEAP_SELECT
2021-01-12 15:08:41 -08:00
e938739115 Prevent nullptr dereference on OOM (#7823) 2021-01-12 14:55:57 -08:00
0203dea024 Added replacement for the Boot ROM _xtos_set_exception_handler (#7820)
Added replacement for the Boot ROM `_xtos_set_exception_handler`
to handle installing our replacement `_xtos_c_wrapper_handler`.

Simplified install in the non 32-bit exception module to make use of the
improved `_xtos_set_exception_handler`

Reorganized and improved comments.
2021-01-12 22:51:26 +01:00
07241dd407 Avoid UB and abort on nullptr buffer (#7822)
* Avoid UB and abort on nullptr buffer
* Report OOM on return value
2021-01-12 22:39:55 +01:00
34545a160d Invalid read return value fix (#7817)
Fixes #7814.

Return 0, not MAXINT, when a read is called on a File without a backing
instance of a SPIFFS/LittleFS/SD File.
2021-01-08 20:08:36 -08:00
98a19ab245 Protect against server hijacking error handling (#7811)
If a server returns "HTTP/1.x -8 OK", for example, it can misguide an application developer into freeing less-important memory so the request can be retried and succeed, when the problem is in the server.

_returnCode is never used anywhere else, but it could still contain a negative value returned by a broken server and therefore could cause troubles in the future (if _returnCode is in fact used)
2021-01-07 21:22:36 -08:00
adbd23b6e2 Add stub for analogReference (#7809)
Fixes #6410

We actually provide a function prototype for `analogReference()` in
`Arduino.h`, but no implementation.  Add a dummy one that only supports
DEFAULT (like other Arduino boards).
2021-01-07 21:14:14 -08:00
67e1dfc5a4 Extended ASM got fussy when using different optimizations. ie. HWDT (#7816)
resets. It seems you should not use input registers for scratch registers.
Add an extra output register instead. No code size increase.

Light refactoring for readability

Added "C" reference code for Extended ASM

Save two cycles by loading a0 early in exc-c-wrapper-handler.S

Use optimization O2
Net change in size, 0 bytes with optimization. Save 4 bytes w/o Optimization.
With changes and "O2" save 3 cycles on write and 6 cycles on read.
2021-01-07 21:05:24 -08:00
2f5979f1f0 Verify IRAM sum results using DRAM as reference. (#7812)
Make verify fail more visible.

Updated example irammem.info to show performance and test int16 handling
when IRAM is used.

Removed 4K performance test. It didn't show any new information over the 1K test.
2021-01-07 20:45:15 -08:00
f959cb321b EspSoftwareSerial 6.11.2: Delegate<> assign operators added. (#7815)
Addresses compilation errors with pending PRs due to commit 95fb104562
2021-01-07 20:36:58 -08:00
43f44e4b13 emulation on host: millis()/micros() now start at 0 (#7810)
emulation on host: millis()/micros() now start at 0
2021-01-05 12:21:16 +01:00
100a8df33f Reduce BearSSL code size by not -O2 FSMs (#7807)
The FSMs that drive the encryption logic are not performance critical,
but they are very large.  Build BearSSL using -Os on them, leaving -O2
everywhere else (i.e. encryption) for speed.

Saves 1-2KB of flash for SSL applications.
2021-01-03 22:47:39 +01:00
da138456a6 Fix header FSM in webserver, fix Windows uploads (#7805)
When a file upload ends in \r\n (i.e. a Windows formatted text file) the
sequence of bytes on the wire is `\r\n\r\n----...boundary-marker...`.

When the FSM in Webserver was evaluating the stream, that 2nd `\r` would
be written as valid data and the FSM parser would be reset and see `\n`
as the 1st character, which wouldn't match.  This would a) add an extra
`\r` to uploaded files, and b) cause uploads to hang.

Fix by checking on a header FSM mismatch if the next character input
could possibly match our marker, and if so handle it properly.

Fixes #7803
2021-01-01 13:07:59 -08:00
5b42e73baa upgrade arduino in CI (#7716)
Thanks to @matthijskooijman, @per1234 and @earlephilhower
2020-12-31 23:19:58 +01:00
a25895a764 Minor EspSoftwareSerial release 6.11.1 (#7804)
* Minor EspSoftwareSerial release 6.11.0: more GPIOs for ESP32

* EspSoftwareSerial: Fix unused parameter warning.

* Revert "Minor EspSoftwareSerial release 6.11.0 (#7802)"

This reverts commit 229903a24d.
2020-12-31 12:56:44 -08:00
229903a24d Minor EspSoftwareSerial release 6.11.0 (#7802)
* Minor EspSoftwareSerial release 6.11.0: more GPIOs for ESP32

* EspSoftwareSerial: Fix unused parameter warning.
2020-12-31 10:54:12 -08:00
84260dcb44 Write loop could lead to wdt with low bitrates or large buffers. Fixes #7746 (#7799) 2020-12-30 16:05:20 -08:00
a3a7a23a92 Typo error in ESP8266WiFiGeneric.h (#7797)
Error in copyright text about Arduino Wifi library
2020-12-27 22:15:26 +01:00
5c29517d11 lwip2: use pvPortXalloc/vPortFree and "-free -fipa-pta" (#7793)
lwip2: use pvPortXalloc/vPortFree instead of malloc/free and add gcc's '-free -fipa-pta' options
2020-12-24 10:56:21 -08:00
5356c87b5b Use smarter cache key, cache Arduino IDE (#7791)
Thanks to @mcspr.  Make sure the cached toolchain is only valid when the
package.json file is identical.  Also, add the Arduino IDE to the cache
to avoid re-downloads.
2020-12-23 15:00:04 -08:00
c487ca5233 Update to SdFat 2.0.2, speed SD access (#7779)
* Update to upstream SdFat 2.0.2

Increases the read/write performance for SD card accesses
by a significant amount, up to 5x (3+MB/s) in testing.

Fixes #7772 

* Add SDFS::availableForWrite handler

Peek into the sector cache to determine the maximum number of
bytes that can be written w/o needing a (slow) SD operation.

Fixes #7650
2020-12-23 11:39:12 -08:00
9de8373f1b BREAKING - Upgrade to upstream newlib 4.0.0 release (#7708)
* Upgrade to upstream newlib 4.0.0 release

Includes 64 bit time_t and 5 years of updates.

Binary incompatible with libraries which use time_t (due to the size
difference).  Recompiling with the new newlib should be sufficient for
most libraries, assuming source is available.

* Remove tools/sdk/libc directory, it isn't used anywhere

Somewhere along the line the copy of libc in tools/sdl/libc was taken
out of the build process.  Files in there are not used, take add'l time
to build and install on a toolchain release, and just cause confusion.
Remove them.

* Fix 64-bit time for LittleFS

The core was setting 64-bit times automatically on new file creation or
updates, but would fail when attempting to read them back due to 64/32b
confusion.

Now attempt to read 64b time, and if that fails fallback to reading 32b
time to allow both old and new FS to preserve timestamps.

* Update to jjsuwa-sys3175 additions to GCC and newlib

@jjsuwa-sys3175 contributed multiple patches to GCC, included in
the toolchain, as well as a slightly faster pgm_read_byte() macro.

* Rebuild w/addl GCC patches, new BearSSL flags

* Remove copied libgcc.a file, is contained in toolchain
2020-12-23 11:21:38 -08:00
e25ad86c91 mock: +hexdump() from debug.cpp (#7789) 2020-12-22 22:50:53 +01:00
51c2a1437b more lwIP physical interfaces (#6680)
This commit adds W5500 W5100 and ENC28j60 drivers from @njh with credits
They are available in libraries/
An example is added in W5500 examples directory

plus:
* Extract dhcp server from lwip2 and add it to the core as a class.
  It must always be present, it is linked and can be called by fw on boot.
  So it cannot be stored in a library.
* ethernet: static or dhcp works
* PPPServer: example
* bring WiFi.config() to the lwIP generic interface (argument reorder common function)
* move hostname() from WiFI-STA to generic interface
* remove non readable characters from dhcp-server comments
* dhcp-server: magic_cookie is part of bootp rfc
* fixes from https://github.com/d-a-v/W5500lwIP/issues/17
* enable lwip_hook_dhcp_parse_option()
* +ethernet tcp client example in w5500 library examples
2020-12-22 22:36:21 +01:00
35d22edeec Rationalize File timestamp callback (#7785)
Fixes #7775

Clean up the passing/setting of custom File time callbacks and add a
host test verifying they work.  Existing core was not passing custom
timeCallbacks set at the FS level down to open()ed files, resulting in
them calling the default time(nullptr) and reporting wrong file modify
times.
2020-12-22 10:41:11 +01:00
f1dc6e90ee Update to LittleFS v2.3 (#7787)
Minor performance improvement and LFS_READONLY added, enabling smaller
code for things like eboot should we want to us it in a bootloader/etc.
2020-12-21 21:21:42 -08:00
032db6fc81 WiFiServerSecure: Cache SSL sessions (#7774)
* WiFiServerSecure: Cache the SSL sessions

* Add SSL session caching to HTTPS server examples

* Document server SSL session caching

* Fix an incomplete sentence in the documentation

* Document BearSSL::Session

* Use the number of sessions instead of the buffer size in ServerSessions' constructors
2020-12-21 21:13:43 -08:00
8add1fd2d9 platform.txt: instruct GCC to perform more aggressive optimization (#7770)
Add `-free -fipa-pta` to GCC options (generates a bit smaller binary)
2020-12-21 21:06:19 -08:00
7dbef42ada LEAmDNS fixes (#7786)
* LEAmDNS2 removed
* LEAmDNSv1: fix macro name
2020-12-22 01:29:00 +01:00
f3521da173 Move uzlib to master branch (#7782)
Merged uzlib with master instead of referencing a branch.  Makes it
saner for future updates (will be off master instead of off "newstuff"
branch).
2020-12-19 10:31:52 -08:00
a9c46d07d5 Update to latest uzlib upstream (#7776) 2020-12-17 14:03:41 -08:00
dbe7eb89b9 EspSoftwareSerial bug fix release 6.10.1: preciseDelay() could delay() for extremely long time, if period duration was exceeded on entry. (#7771) 2020-12-15 12:22:57 -08:00