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

4153 Commits

Author SHA1 Message Date
david gauchard
4cc1472821
[BREAKING] base64::encode() compat with esp32: no newlines by default (#7910) 2021-03-14 17:24:33 -07:00
Earle F. Philhower, III
656a33e6f8
BREAKING - Use IRAM_ATTR in place of ICACHE_RAM_ATTR (#7921)
Update the core to use the define that the ESP32 uses, IRAM_ATTR, for
placing code in DRAM.
2021-03-14 16:56:47 -07:00
Dirk O. Kaar
6743a65987
Minor EspSoftwareSerial release 6.11.7, for deprecated ICACHE_RAM_ATTR in upcoming ESP8266 Arduino core 3.0.0. (#7922) 2021-03-14 16:15:37 -07:00
Develo
49a09279eb
Merge pull request #6280 from aerlon/wifi_mesh_update_2.2
WiFi Mesh Update 2.2
2021-03-14 18:11:32 -03:00
Develo
7fbf620ab6
Merge branch 'master' into wifi_mesh_update_2.2 2021-03-14 16:41:13 -03:00
david gauchard
444002180b
OOM debug: warn about String reallocation (#7908)
* OOM debug: warn about String reallocation

* threshold set to 128 bytes, +defines

* warn only when capacity had already reached the threshold
2021-03-14 07:57:23 +01:00
ksalwin
e07542d701
Fix link to ESP8266 NonOS SDK (#7914) 2021-03-11 07:24:24 -08:00
Earle F. Philhower, III
e99df4fe1a
Add I2S class support (#7874)
Fixes #427

Adds a basic I2S class based off of the Arduino-SAMD core.  The raw
i2s_xxx functions are still a better  way to use I2S due to their
flexibility, but this will allow basic Arduino sketches to work.
2021-03-07 08:14:07 -08:00
david gauchard
9fc5afd5fd
OOM: avoid warn when calling *alloc(0) (#7909) 2021-03-04 13:27:42 -08:00
Earle F. Philhower, III
d3d49d5db4
Update mklittlefs executable (#7906)
Rebuild entire toolchain instead of manually hacking the tools JSON to
ensure repeatability.

New mklittlefs sets the new FS timestamp added in #7873
2021-03-04 11:29:38 +01:00
Chris van Marle
c90c329a48
Track creation time of LittleFS FS (#7873) 2021-03-02 17:50:00 -08:00
Drzony
22442f0873
Added ESP32 compatible methods for setting/getting hostname (#7900) 2021-03-02 17:32:34 -08:00
david gauchard
807ed51d0f
AP & dhcp-server: fix uninitialized variables (#7905) 2021-03-03 01:12:01 +01:00
Dirk O. Kaar
e3fe7a5776
EspSoftwareSerial, bump up Arduino library manager related files 6.11.6 (#7891) 2021-02-21 11:04:37 -08:00
Dirk O. Kaar
f42ab617e9
Update to EspSoftwareSerial 6.11.5 (#7889) 2021-02-21 09:23:20 -08:00
david gauchard
a5308d6ef4
String: add missing long long operator implementations (#7888) 2021-02-19 08:38:43 -08:00
Foddis Gabriele
d41b4037cc
board manager: + Agrumino lemon v4 (#7883) 2021-02-19 08:21:16 -08:00
twischer
83f5f29cfd
Support to reboot into UART download mode (#7854)
without any external wiring.

This patch introduces the new method
Esp.rebootIntoUartDownloadMode()

When the user calls this method the ESP8266 reboots into the UART
download mode. In this mode the user can use esptool.py to flash a new
firmware file. The following command was used to test it:
$ esptool.py --before no_reset --after soft_reset --chip esp8266 \
    --port /dev/ttyUSB0 --baud 460800 write_flash 0x0 firmware.bin

The implementation is based on the original implementation in the
boot ROM. Some parts of the original implementation can be found in
[1]. This patch is a squashed and simplified version of [2]. The non
squashed version might be helpful in case of debugging issues.

[1] https://github.com/twischer/xtensa-subjects/blob/master/reversed/bootrom.c
[2] https://github.com/twischer/Arduino/tree/reboot_uart_download_full

Signed-off-by: Timo Wischer <twischer@freenet.de>
2021-02-17 08:25:52 -08:00
Michael Pöttgen
bc3daef76d
WIFI_RESUME improve speed and example (#7877)
Improve resume speed by passing in last known BSSID
Provide a simpler example for WIFI_SHUTDOWN/WIFI_RESUME
Add documentation for WIFI_SHUTDOWN and WIFI_RESUME.
2021-02-15 13:51:37 -08:00
Earle F. Philhower, III
e4435fa306
Update board-specific defines (#7875)
Fixes #6805

Update the build.board for several boards which were originally added
with a generic type.
2021-02-14 14:42:50 +01:00
david gauchard
483519f852
String: compatibility with 64 bits scalars (#7863)
time_t is now 64 bits. String(time_t) was ambiguous
tests added
2021-02-13 08:47:47 -08:00
Earle F. Philhower, III
a886515ce9
Fix ESP8266SdFat architecture, Windows CI (#7866)
* Fix ESP8266SdFat architecture

Avoid problems reported in
https://forum.arduino.cc/index.php?topic=726897.msg4889319

* Fix Windows CI, python3 now *maybe* exists

Python3 used to be called "python.exe" on earlier VMs, but it looks like
the image has been updated and a "python3.exe" does now exist.  Update
the CI script to first check it "python3" exists, and if not then do the
copy hack, OTW do nothing.
2021-02-08 12:02:49 -08:00
Earle F. Philhower, III
07b4c09b90
eboot: .RODATA, upstream uzlib, move CRC, save 112 bytes (#7844)
RODATA can be copied automatically by the bootrom, so no reason not to
allow its use for strings and constants in eboot.c

Revert to pfalcon's original uzlib since the single patch to remove
RODATA is not required.

Rationalize eboot.ld linker script, clean up BSS and init it in code.

Saves 112 bytes of space in the bootloader sector by removing the
extra code associated with literal loads.

* Move CRC out of bootload sector

We added protection to only erase the bootload sector when flashing an
image when the new sector != the old sector.  This was intended to
minimize the chance of bricking (i.e. if there was a powerfail during
flashing of the boot sector the chip would be dead).

Unfortunately, by placing the CRC inside the eboot sector *every*
application will have a unique eboot sector (due to the crc/len), so
this protection doesn't work.

Move the CRC into the first 8 bytes of IROM itself.  This frees up extra
space in the boot sector and ensures that eboot won't be reflashed
unless there really is an eboot change.
2021-02-07 16:32:56 -08:00
Dirk O. Kaar
6c564c269c
EspSoftwareSerial bug-fix release 6.11.4 (#7862) 2021-02-06 15:10:24 -08:00
hreintke
27da34760b
At MDNS.end() also release services (#7859) 2021-02-04 14:46:13 +01:00
Earle F. Philhower, III
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
Earle F. Philhower, III
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
Earle F. Philhower, III
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
Earle F. Philhower, III
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
Michael Kluge
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
Dirk O. Kaar
53e5688453
Update to EspSoftwareSerial 6.11.3: prepares for ESP8266 Arduino core PR 6979. (#7840) 2021-01-26 01:03:56 +01:00
Earle F. Philhower, III
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
Earle F. Philhower, III
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
Earle F. Philhower, III
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
david gauchard
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
Valerii Koval
11a2fb3872
Dynamically configure exceptions support (#7834) 2021-01-22 17:08:45 +02:00
Develo
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
Erriez
d90015e326
Merge branch 'master' into feature/issue-2246-multi-wifi-hidden 2021-01-19 16:12:54 +01:00
Paulo Cabral Sanz
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
Earle F. Philhower, III
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
M Hightower
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
Earle F. Philhower, III
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
M Hightower
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
Paulo Cabral Sanz
e938739115
Prevent nullptr dereference on OOM (#7823) 2021-01-12 14:55:57 -08:00
M Hightower
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
Paulo Cabral Sanz
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
Earle F. Philhower, III
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
Paulo Cabral Sanz
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
Earle F. Philhower, III
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
M Hightower
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