1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

2949 Commits

Author SHA1 Message Date
david gauchard
149af7618c
boards generator: new option --allgen (#4614)
useful when changing and pushing updates
2018-04-07 20:16:04 +02:00
Bryce Schober
3a110aa698 Allow other ESP debug port class types (#4611)
... by casting to void pointers before comparison to avoid compile error
2018-04-06 11:23:46 +02:00
david gauchard
b93cba1046
simple fixes (#4597)
* wemos d1 r1: move comment out of define line
* update 4M filesystem info
2018-04-03 01:58:22 +02:00
Earle F. Philhower, III
f2c7256539 Add flash for vtable destination, make it default, and add build menu to control options (#4582)
* Add flash for vtable destination, make it default

Add an option for placing vtables in flash to complement the existing
iram and heap options.  "make flash"

Now that there is a way to change it, move to vtables in flash as default
as only users with interrupts which use vtables require the vtable to
be in RAM.  For those users, if the tables are small enough they can put
them in IRAM and save heap space for their app.  If not, then the vtables
can be placed in HEAP which supports much larger tables.

* Add VTable menu, FLASH as default, remove Makefile

Convert from manual "make" operated app.ld creation to runtime creation
whose options are selected from the build menu.

Use a prelink recipe to create the output app.ld file each run, without
need for any special tools.

Update the boards.txt.py script to generate this new config.
2018-04-03 00:32:35 +02:00
Earle F. Philhower, III
8ae553d99e
I2s input API and examples (#4539)
Enables I2S stereo input via DMA using new API calls:

. i2s_rxtx_begin(bool rx, rool tx);
. i2s_read_sample(uint32_t *l, uint32_t *r);

Original API calls will only enable TX, so this is backwards compatible.

Add simple I2S input example code using Arduino serial plotter.

Add UDP transmit of I2S microphone data to a PC (remote microphone).

Clean up and reorganize code to share RX and TX logic as much as
possible.  Fix a potential WDT error while in blocking sample read
and write.
2018-04-02 07:37:21 -07:00
i3water
7ae8f98e57 add board WiFiduino (#4590) 2018-04-01 18:51:59 +02:00
Kyle Fleming
212a829942 Move cont_init from ram to flash (#4384) 2018-03-31 19:32:34 -03:00
Iman Ahmadvand
241531aa4c Adding softAP SSID & PSK query API (#4138)
* softAP SSID & PSK query API added.
Signatures:
String ESP8266WiFiAP::softAPSSID() const;
String ESP8266WiFiAP::softAPPSK() const;

* Fix for proper C-style string copy

* add API to validate input ip as string
Signatures:
static bool IPAddress::isValid(const String& arg);
static bool IPAddress::isValid(const char* arg, size_t len);

* fix indentation

* fix ip string validation to use built-in implementation.
signatures:
static bool isValid(const String& arg);
static bool isValid(const char* arg);
2018-03-28 09:27:20 -03:00
Develo
29580e8166
Fix for #4565 (rx fifo length), protect access to rx_buffer (#4568)
* Fix for #4565 (rx fifo length), protect access to rx_buffer

* Fix typo

* reworked to separate safe from unsafe functions, factorized some code, constness

* additional rework for uart_rx_fifo_available()

* swapped unsafe function definition order

* Remove static for overrun string

* Some shorthand for perf and readability
2018-03-27 22:28:39 -03:00
Earle F. Philhower, III
decfbdda5f I2S driver fixes for IRQs, protocol, factoring (#4574)
* I2S driver fixes for IRQs, protocol, factoring

All redundant ICACHE_FLASH_ATTR decorators were removed, we already do
this by default for all routines, anyway,

The actual ISR and its called function moved to to IRAM.  Used to be in flash
due to the decorator, which could lead to crashes.  Use ets_memset to mute
buffers in ISR.

Fix the I2S on-the-wire protocol by enabling the transmit delay I2STMS because
I2S is supposed to send the MSB one clock after LRCLK toggles.  This was
causing I2S to be twice as loud as intended in the best of cases, and causing
garbage/noise output when the MSB was set since data was effectively shifted.

Refactor the clock divider setting to be done in one function only, as there
is no reason to do the same complicated bit setting in two spots.

* Comment some add'l registers, use optimstic_yield

Comment the known and unknown I2S register settings for posterity, using
the ESP32 guide as a basis.

Use optimistic_yield() instead of esp_wdt_disable/enable when busy
waiting in blocking writes to ensure we don't hog the CPU completely.

Move the constant IO pins to #defines for easier understanding.
2018-03-27 20:40:34 -03:00
Earle F. Philhower, III
a3a3654584 Add linker MAP artifact to standard build process (#4186)
Generate and preserve a linker .MAP file for the project in the usual
build directory.  This map file is useful for finding out where FLASH,
IROM, and IRAM are being used as it shows gcc internally generated
things such as jump tables and constant function-local variables.
2018-03-27 14:06:56 +02:00
david gauchard
f2187f50c7
ldscripts: a Makefile to change c++ vtables location (#4567) 2018-03-26 23:35:57 +02:00
Marco Bisioli
e1ca870695 defined SDA and SCL pins for Olimex MOD-WIFI-ESP8266(-DEV) (#4562) 2018-03-26 22:47:11 +02:00
david gauchard
ee1ef4a795 restore HardwareSerial::write(str) (#4564)
* restore HardwareSerial::write(str)

* restore HardwareSerial::write(str) (this time checked)
2018-03-26 12:15:29 -03:00
Christoph Gommel
2105b8b06f Update core_esp8266_si2c.c (#3389)
With this patch the set up clock rate survives a re-init that is done by many libraries several times.

This makes e.g. an accelerated OLED display possible with the adafruit libraries
2018-03-24 17:23:25 -03:00
derSeddy
6464ae0c79 Added 50kHz operation mode for I2C/Wire library (#3401) 2018-03-24 15:46:29 -03:00
mrwgx3
438d3f1d11 Update core_esp8266_si2c.c (#4070)
* Update core_esp8266_si2c.c

Add 'clockCount' decrement, while-loop, twi_status()

* Update core_esp8266_si2c.c

Indents in changed function, removed superflous else
2018-03-24 14:49:27 -03:00
Zhenyu Wu
2d39bcba7d Resolve updater size check bug (#4550) 2018-03-23 15:01:17 -03:00
david gauchard
559cb35025 spi: use const for output buffers (#4552) 2018-03-23 13:39:20 -03:00
Ivan Grokhotkov
95b1348a71 WiFiClient: clean up ClientContext before connecting (#4516)
Fixes https://github.com/esp8266/Arduino/issues/4497
2018-03-23 12:19:45 -03:00
david gauchard
d5cbd91775 device test for #4516 (WiFiClient leaking) (#4549)
* device test for #4516 (WiFiClient leaking)

* simply count the number of connections that do not change heap

* remove unused heapLost

* + python server (to not depend on gateway's opened tcp port)

* remove old&bad define

* fix another old address
2018-03-23 11:30:59 -03:00
Earle F. Philhower, III
42f824b2e4 Fix WebServerSecure streamFile() (#4545)
* Fix WebServerSecure streamFile()

ESP8266WebServerSecure's streamFile was using the base class' method
which did not use SSL encrypt before transmitting, leading to failure.

Add a new template method and required support for
WiFiClientSecure::write(Stream&) (using a local temp buffer since the
SSL libs do not grok Arduino Streams at all).

Fixes #4544

* Match ClientContext buffer and yield() behavior

ClientContext sends out 256 bytes at a time and gives a yield after
each chunk to ensure the WDT doesn't fire.  Mimic that behavior in
WiFiClientSecure::write(Stream&).
2018-03-22 00:53:37 -03:00
Harald
3267443348 Fix random crashing of ClientContext::write(Stream) and write_P(PGM_P buf, size_t size) (#2504) (#4530)
* Fix random crashing of ClientContext::write(Stream) and write_P(PGM_P buf, size_t size) (#2504)

* - Allow partial buffer release

* - Refined comments
2018-03-22 00:01:22 -03:00
david gauchard
479f1b3fed HardwareSerial: one more duplicate test missing the call (#4547) 2018-03-21 22:26:34 -03:00
david gauchard
f8f205d54a
Inefficient Print::write(data,len) shows message if used (only in debug mode) (#4537)
* inefficient Print::write(data,len) shows message if used (only in debug mode)
* make HardwareSerial's write(data,len) efficient
* HardwareSerial: remove duplicate tests, move trivial code from .cpp to .h
2018-03-22 01:23:58 +01:00
david gauchard
2013af1b19
fix minor issues in test runner scripts on device (#4542)
* tests/device/Makefile: use bourne shell compatible "." instead ot "source" (ubuntu's dash does not understand it)

* tests/device: make BEGINTIMEOUT a new error return value instead of a test-process-breaking exception
2018-03-21 17:07:23 +01:00
david gauchard
6580bf3477
uart: fix wdt input overrun (#4536)
* uart: fix wdt on uart input overrun, expose in HardwareSerial::hasOverrun()
2018-03-21 13:28:34 +01:00
Ryan MacLean
6d3f0b4023 Two More Typos (#4534)
`Adruino` and a verb conjugation.
2018-03-19 16:50:26 -03:00
Kristijan Gjoshev
f9110f51c2 Add I2S callback on DMA read (#4205)
Add optional callback after every DMA buffer interrupt for lower delay, better timing control of I2S output.
2018-03-19 09:25:34 -07:00
Jon H Peterson
d112dfa476 Update readme.rst (#4131)
* Update readme.rst

fix broken link to file system flash layout

* linkage repair

my second shot at fixing the external page link for "flash layout". It appears that the on-page link to "Update Process - Memory View" was broken (not sure if I got this one right or not).
2018-03-19 10:42:53 -03:00
Ryan MacLean
99d28902fb Quick Typo Fix (#4532) 2018-03-18 16:28:59 -03:00
Juraj Andrássy
891113678c SPISlave.end() added (#4248)
* Change argument to Esp.deepSleep from uint32 to uint64 to match SDK, add deepSleepMax based on the cali_proc function per SDK

* SPISlave.end() added

* Nameoftherose patch for Issue #2435 (#4256)

* WiFiTelnetToSerial Example - Minor Issues #2435

* WiFiTelnetToSerial Example - Minor Issues #2435

Patch to rectify issue #2435

* Check that pins needed by Wire are defined at compile-time (#4261)
2018-03-18 01:53:54 -03:00
Earle F. Philhower, III
855b03ce4d Fix exception handler, add assert, reduce RAM (#4187)
Move all exception strings to IRAM and out of both PMEM (illegal) and add
output of any assert() failinf conditions.

The exception handler may be called while the SPI interface is in a bad
state.  This means no PROGMEM reads are allowed, and all data and functions
used must be in system RAM or IRAM.

Add a new helper macro, ets_printf_P(), which places a constant string in
IRAM and copies it to the stack before calling the real ets_printf().
This makes the code simpler to read as no unwieldy combinations of
ets_putc/ets_printf/... are required to output anything.

The old handler also mistakenly used PSTR() strings in some places, so
fix those with this patch as well.

Gives back ~180 bytes of heap to every sketch built as the exception handler
is always included an application.
2018-03-18 08:53:08 +08:00
fabianoms
4e2e1f268c AddServiceTxt returning bool (issue #1962) (#4507) 2018-03-17 20:16:26 -03:00
Earle F. Philhower, III
4a958c8444
Record last failed alloc, dump on a panic (#4220)
At runtime, whenever a realloc, malloc, calloc, or new call fails to
find enough memory, record the calling function and size requested.
Does not print anything or call any heavyweight functions on this, as it
is legal to return NULL to an alloc-type call.

If the main application handles this NULL properly, there should be no
panic and nothing different will happen.

If the main application panics() at any later point in time, this record
will be printed out as part of the crash log for processing with an
updated EspExceptionDecoder.java.

This adds 2-3 instructions overhead in the normal case, and around 10-12
instructions in the failing case, and requires an additional 8 bytes of
.BSS to function.

Only a single address is kept, the final failing malloc-type function call
before a panic, but it is trivial to extend to a fifo with little overhead
in the common, non-failing case.
2018-03-17 07:51:32 -07:00
Earle F. Philhower, III
06352ab0e1 Check Print::write(byte) return and stop on fail (#4527)
The default Print::write(byte, count) method was continuing to send
bytes one-by-one even when a prior write returned 0.  Because the buffer
pointer was incremented no matter success or fail, this leads to data
corruption as you'll not send some bytes in the middle and will then
send extra bytes past the end of the passed in buffer.

Because there's no concept of timeout, just stop on the first time
write(byte) fails and return the total bytes successfully written
and let the user worry about retrying or handling an error.

Found by @d-a-v and discussed on gitter.
2018-03-17 01:38:56 -03:00
david gauchard
732e22ec37
OOM debug option: simplify its management and make it compatible with arduino-1.9beta (#4357) 2018-03-16 19:56:32 +01:00
Earle F. Philhower, III
edd2754e2f
Remove stray sigma_delta.h header (#4523)
Remove stray, older version of sigma_delta.h

An older version of sigma_delta.h was committed to the root directory. Remove it, as we only want the later, new one already present in cores/esp8266. Thanks, @reaper7, for noticing it.
2018-03-16 07:56:34 -07:00
Jonatan Olofsson
461c922586 Compressed dns (#3769)
* Add UdpContext seek and tell

* Add support for DNS compressed messages

* mDNS compressed pointer: Validate offset before jumping
2018-03-16 09:46:35 -03:00
Shawn A
836c7da8cc adds getautoreconnect() (#4359) 2018-03-16 01:15:30 -03:00
ZaPpInG
30155f2ad3 Fix menu and checklist in a01-espcomm_sync-failed (#4512)
Fix menu and checklist in a01-espcomm_sync-failed.rst
2018-03-16 00:04:56 -03:00
fabianoms
3ce888e87b macro attributes should be used with brackets
related to the issue #2617.
2018-03-13 12:39:08 +08:00
david gauchard
c51c7b47ee
4m2m support in ldscripts (#4454)
* 4m2m support in ldscripts (fix boards generator for new ldscripts generation)
2018-03-13 00:35:16 +01:00
mrwgx3
3934d10f21 Correct millis() drift, issue #3078 (#4264)
* Correct millis() drift, issue 3078

* Add 'test_millis_mm.ino' runtime benchmark

* Eliminate 'punning' warning

Add union 'acc' in millis() to eliminate 'punning' compiler warning

* Correct minor typo

* Eliminate 'punning' warning

 Add union 'acc' to eliminate 'punning' compiler warning  in 'millis_test'_DEBUG() and 'millis_test()'
2018-03-12 15:28:04 -03:00
per1234
5c0a57ff6d Specify units in CheckFlashConfig example sketch (#4490) 2018-03-12 11:54:21 -03:00
Steven Conaway
4b9d3d9e33 Fix some typos in the FAQ (#4503) 2018-03-12 01:15:50 -03:00
Steven Conaway
ad5691d637 ie --> in (#4502) 2018-03-12 00:13:53 -03:00
Steven Conaway
f070b55e11 Fix ESP8266WiFi/Diagnostics/Check Return Codes (#4504) 2018-03-11 21:09:03 -03:00
Earle F. Philhower, III
afcbcd5cc9
Add support for hardware Sigma Delta generator
Provides a simple interface to attach/detach pins to the sigma-delta generator, and get/set the 2 parameters prescaler & target.  Working example that fades the onboard LED is provided.  Code and sample by @stefaandesmet2003.
2018-03-10 12:07:04 -08:00
Ivan Grokhotkov
3b269c4a96 postmortem: raise exception when assert happens
Fixes https://github.com/esp8266/Arduino/issues/4480
2018-03-09 12:47:22 +08:00