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

3567 Commits

Author SHA1 Message Date
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
4e2e1f268c AddServiceTxt returning bool (issue #1962) (#4507) 2018-03-17 20:16:26 -03:00
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
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
732e22ec37 OOM debug option: simplify its management and make it compatible with arduino-1.9beta (#4357) 2018-03-16 19:56:32 +01:00
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
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
836c7da8cc adds getautoreconnect() (#4359) 2018-03-16 01:15:30 -03:00
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
3ce888e87b macro attributes should be used with brackets
related to the issue #2617.
2018-03-13 12:39:08 +08:00
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
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
5c0a57ff6d Specify units in CheckFlashConfig example sketch (#4490) 2018-03-12 11:54:21 -03:00
4b9d3d9e33 Fix some typos in the FAQ (#4503) 2018-03-12 01:15:50 -03:00
ad5691d637 ie --> in (#4502) 2018-03-12 00:13:53 -03:00
f070b55e11 Fix ESP8266WiFi/Diagnostics/Check Return Codes (#4504) 2018-03-11 21:09:03 -03:00
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
3b269c4a96 postmortem: raise exception when assert happens
Fixes https://github.com/esp8266/Arduino/issues/4480
2018-03-09 12:47:22 +08:00
170911a689 gdbstub, postmortem: clean up
- Move GDB stub hooks into a separate file, provide header for it
- Use syscall instruction raise user mode exception
- Remove unused code in postmortem.c

fixup

fixup
2018-03-09 12:47:22 +08:00
0643d6e7ab Bugfix/persistentchecks (#3798)
* persistent check fixes

fixes assumtions that persistent matches current configs, and prevents changes when such conditions exist

* oops

* fix code compliance block scoping
2018-03-08 23:55:09 -03:00
ac546acb80 Remove reference to an arrow/_right that doesn't exist (#4401)
Remove the reference to an arrow/_right that doesn't exist.
2018-03-08 15:15:18 -08:00
70f522cff8 Fix stack trace unwinding within continuation lib (#4385) 2018-03-08 17:21:47 -03:00
7f0b9d1be9 Rx fifo latency fix (#4328)
* Flush the rx fifo when checking available bytes in fifo.  This gives a more correct result rather than waiting until either the fifo is full or until a serial rx timeout occurs.

* When rx_avaiable is checked return rx_buffer plus rx_fifo.  Then during rx_read and rx_peek functions copy over the data in the fifo as needed.

* Clean up early out case.

* Set the rx full fifo ISR to trigger a little sooner.  This makes the uart rx isr more robust in cases where the ISR can't trigger very fast
2018-03-08 12:16:14 -03:00
61cd8d8385 examples: format all .ino files
This formats all the example source files using Arduino style rules.
2018-03-08 14:32:06 +08:00
e226251b27 ci: check examples code style
Use code style defined in Arduino project to check code style of the
examples. The check is done by formatting all files with astyle and
checking whether any changes have been introduced.
2018-03-08 14:32:06 +08:00
af74a10d27 Bump version to 2.5.0-dev 2018-03-08 12:39:41 +08:00
614f7c32e5 Release 2.4.1 2.4.1 2018-03-08 11:49:56 +08:00
e52ead1e83 doc: remove changelog
Change logs are now hosted on Github releases page.

Closes #4142
2018-03-08 11:49:48 +08:00
8053f285b1 provide full version descriptor, displayed in debug mode (#4467)
* provide full version descriptor, displayed in debug mode

* unix: shows core version like under windows when git is unavailable

* store strings in progmem

* version string honours NDEBUG

* add ARDUINO_ESP8266_GIT_DESC
restore ARDUINO_ESP8266_GIT_VER
restore global variable "core_version"
don't print full version on setDebugOutput(true)
set platform.txt version to 2.4.1-pre
hide irrelevant boot version
fix typo

* lwip2: fix disconnection/reconnection issue
also:
improve version string
remove useless message

* lwip2: bump tag before 2.4.1

* lwip2: improve netif flags management on git side

* full-version string: remove useless NDEBUG in separate source file

* do not automatically enable sdk messages along with core messages

* automatically reenable sdk messages along with core messages *before* setup not after

* check serial port when showing version-string + move sdk messages enabler in hardware serial

* + license header

* updated and tested windows commands in platform.txt (without git)

* updated and tested windows commands in platform.txt (without git)

* update package builder accordingly
2018-03-08 11:37:03 +08:00
5b87c7b82d Update ISSUE_TEMPLATE.md (#4474)
* Update ISSUE_TEMPLATE.md

Proposal for issue template update

* Update ISSUE_TEMPLATE.md

Updates per feedback.

* Update ISSUE_TEMPLATE.md

Update based on feedback.
2018-03-07 20:14:55 -03:00
e47a92a836 lwip2: improve netif flags management on git side 2018-03-07 22:47:04 +08:00
3df3246514 lwip2: bump tag before 2.4.1 2018-03-07 22:47:04 +08:00
2335f18f5a lwip2: fix disconnection/reconnection issue
also:
improve version string
remove useless message
2018-03-07 22:47:04 +08:00
7999f5c29c Use correct separator in keywords.txt
The Arduino IDE currently requires the use of a tab separator between the name and identifier. Without this tab the keyword is not highlighted.

Reference:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords
2018-03-05 15:51:14 +08:00
a2e7c7d016 (bool)WiFiClient needs to return ::connected() since ClientContext is not destroyed on ::stop() (#4422) 2018-03-02 20:27:08 -03:00
1349bafd83 [WIP] ESP8266WiFi: initialize new fields, remove old workaround (#4413)
* ESP8266WiFi: initialise new STA configuration fields

* ESP8266WiFi: remove workaround for wifi_station_ap_number
2018-02-28 17:21:32 -03:00
19eb6ea548 Fix small typo in documentation. (#4440) 2018-02-28 15:41:15 -03:00
9127e6eaac Fix some links (#4408)
Fix some links
2018-02-28 14:32:52 -03:00
29789b1193 fixed replyPakcet to replyPacket (#4439)
Fixed variable name
2018-02-27 15:21:16 -03:00
cd6cd85fca sdk: add a script for library update
Moves instructions from Readme file into a script
2018-02-22 14:11:43 +03:00
c885542f05 sdk: update to v2.2.0-3-gf8f27ce
- Fixes WiFi not being able to reconnect after SDK update (#4398)
- Fixes increased current in light sleep mode
- Fixes return value documentation for wifi_{get,set}_country
2018-02-22 14:11:43 +03:00
00c8b633df platform, boards: add menu to control what gets erased during upload 2018-02-20 21:51:53 +03:00
0222e32f15 esptool: update to 0.4.13
- fix argument parsing for flash erase command (-ce)
- add region erase command (-cz)
2018-02-20 21:51:53 +03:00
e5746c0f5a Merge pull request #4399 from ivankravets/master
Drop PlatformIO lines from LD script; append object suffix to the end of target name // Resolve #4355
2018-02-20 15:01:57 +02:00
f2fc590d51 Drop PlatformIO lines from LD script; append object suffix to the end of target name // Resolve #4355 2018-02-20 13:40:54 +02:00
ee5a1e2804 WiFiClient: don’t destroy ClientContext on ::stop
Reported in https://github.com/esp8266/Arduino/issues/4078.

WiFiClient::stopAll, called from a WiFi disconnected event handler,
could be called while WiFiClient::connect was in progress. This issue
was initially fixed in #4194, by testing `this` pointer for being
non-null in ClientContext::connect.

This change delegates deletion of ClientContext to WiFiClient
destructor. WiFiClient::stop only calls ClientContext::stop, which
closes/aborts the connection.
2018-02-20 03:33:55 +03:00
28d8a41219 ESP8266WiFi: zero-initialise scan_config structure
Fixes #4394
2018-02-20 03:33:03 +03:00
0a000fef95 Merge pull request #4393 from esp8266/ivankravets-patch-2
Revert "Remove @PlatformIO library.json from GDBStub; fix pattern in LD"
2018-02-20 01:00:40 +02:00
dcb67599b5 Revert "Remove @PlatformIO library.json from GDBStub; fix pattern in LD"
Reverts esp8266/Arduino#4363
2018-02-19 23:28:14 +02:00
f3f00ed64e gitignore: ignore generated files 2018-02-19 17:11:48 +03:00