* Release referenced resources in destructor
* Release referenced resources in destructor, corrected for IPV6
* Release referenced resources in destructor, per suggested changes
* Add fix for SoftwareSerial submodule errors to documentation
* Update installing.rst
Replaces and based on #5602Fixes#5583
* Update installing.rst
Remove forgotten section
Add update section for Other OS
* Fixes 1.1
- Better separation of ESP wifi thread code from user thread code
- Added a flag for 'update()'-less use (disabled by default)
- The too fast updates for service queries are fixed
- Switched fully to PolledTimeout; LEATimeFlag not needed anymore (BTW: a const 'expired()' method would be helpful)
- The device should stay visible now even after the first TTL timeout
- Improved service querying (queries five times now)
* Update mDNS_Clock.ino
Removed references to LEATimeFlag.h
* Update mDNS_Clock.ino
Styling
* Remove broken ltoa/ultoa, call itoa/utoa
Use the newlib integer-to-ASCII non-POSIX calls instead of rolling
our own. Should be safe as sizeof(long) == sizeof(int).
The custom functions behaved differently from itoa when passed in
negative values in non-base-10.
Add host tests for negative non-base-10 int/longs
* Make waveform generator a NMI to run always
Make the waveform generator an NMI using the same code as in 2.4.0.
Making it NMI will ensure it runs even when interrupts are disabled.
Fixes#5568
* Move to a lockless waveform generator
Make the waveform generator lockless by doing all dangerous structure
updates in the interrupt handler. start/stopWaveform set a flag and
cause an interrupt. They wait for the interrupt to complete and clear
those flags before returning.
Also rework the Waveform[] array to be lockless.
* Optimize IRAM and CPU usage in IRQ
Try and minimize the IRAM needed to run the IRQ while keeping performance at
or better than before.
* Avoid WDT errors, optimize pin scans
Calculate first and last pins to scan for PWM, significantly increasing
accuracy for pulses under 10us at 80MHz. Now if you are using a single
PWM channel at 80MHz you can generate a 1.125us pulse (down from ~4us).
Rework the IRQ logic to avoid potential WDT errors. When at 80MHz it
appears that interrupts occuring faster than 10us apart on the timer
cause WDT errors. Avoid it by increasing the minimum delay between
IRQs on the timer accordingly.
* Clean up format/comment, remove delay() in stop
stopWaveform may be called from an interrupt (it's called by digitalWrite)
so we can't call delay(). Make it a busy wait for the IRQ to clear the
waveform.
Only set a new timeout of 10us when starting a new waveform when there
is no other event coming sooner than that.
Update formatting and comments per @devyte's requests.
Replace MicrosecondsToCycles() with standard Arduino call.
All interrupt service routines are supposed to be in IRAM now, so there
is no need to keep interrupts disabled while doing flash operations.
Remove the IRQ disable/enable from the ESP.flash* methods.
Related to #5568
There is a bug in the BearSSL PEM decoder when Windows EOLs (\r\n) are
passed in. Avoid the issue by silenly discarding \rs as they are read
from the PEM source in the C code, to keep my sanity by avoiding reworking
the pseudo-Forth parser code.
Fixes#5591
* DNSServer: Handle examplewww.com correctly
Just replacing 'www.' with the empty string when we assign the
domainname will remove all occurrences of 'www.', not just those
at the start of the string.
Change this to a startsWith check so that only "www." at the
beginning of the string is removed.
* DNSServer: Rework request handling
Rewrite the request handling in the DNSServer code to address the
following issues:
Compatibility with EDNS #1:
RFC6891 says that
"Responders that choose not to implement the protocol
extensions defined in this document MUST respond with a
return code (RCODE) of FORMERR to messages containing an
OPT record in the additional section and MUST NOT include an
OPT record in the response"
If we have any additional records in the request, then we need
to return a FORMERR, and not whatever custom error code the user
may have set.
Compatibility with EDNS #2:
If we're returning an error, we need to explicitly zero all of
the record counters. In the existing code, if there is an
additional record present in the request, we return an ARCOUNT
of 1 in the response, despite including no additional records
in the payload.
Don't answer non-A requests
If we receive an AAAA request (or any other non-A record)
requests, we shouldn't respond to it with an A record.
Don't answer non-IN requests
If we receive a request for a non-IN type, don't answer it
(it's unlikely that we'd see this in the real world)
Don't read off the end of malformed packets
If a packet claims to have a query, but then doesn't include
one, or includes a query with malformed labels, don't read off
the end of the allocated data structure.
* DNSServer: Clarify and tidy writing the answer record
Modify the code used to write the answer record back to the server
so that it is clearer that we are writing network byte order
16-bit quantities, and to clarify what's happening with the pointer
used at the start of the answer.
PR #5538 made exceptions disabled by default and changed some file names
which didn't get updated in the linker file, resulting in exceptions ending up
back in IRAM.
Scripts, makefiles, and users who do no changes will not have exceptions
enabled during builds. This should avoid the sketch inflation issue for
users who are space constrained, while allowing users who care about
exceptions to enable them through the IDE.
* [PUYA] Applied ESPeasy puya_v3.patch
Applied the patch to get the starting point as described in https://github.com/esp8266/Arduino/issues/5493
* [PUYA] Only allocate memory when PUYA detected
core 2.5.0 PUYA patch, no puya:
Description Function #calls call/sec min (ms) Avg (ms) max (ms)
Save File 4 0.25 34.755 45.264 67.620
Free Mem: 16168
core 2.5.0 PUYA patch, Faked Puya detect:
Description Function #calls call/sec min (ms) Avg (ms) max (ms)
Save File 2 0.04 41.332 57.544 73.756
Free Mem: 11560
* [PUYA] Check for PUYA chip as soon as possible at boot
Check for PUYA chip in call for `getFlashChipId()`
This will only be done once and the result of the get function is also cached.
* [PUYA] Use limited buffer (512 byte) allocated at first write
No need to allocate a buffer when not writing to flash.
The default buffer size is 512 bytes, which is 2 pages in the flash chip.
* [PUYA] Lower PUYA flash buffer to 1 page (256 B)
As discussed here: https://github.com/esp8266/Arduino/issues/5493#issuecomment-447543279
* [PUYA] Fix indents naming and return conditions
* [PUYA] Move Puya write code to spi_flash_write_puya
* [PUYA] Make spi_flash_write_puya static and define PUYA_SUPPORT
* [PUYA] Add some SPI flash vendor IDs
As requested by @igrr https://github.com/esp8266/Arduino/pull/5504#discussion_r242016184
* [PUYA] All suggested changes.
See: https://github.com/esp8266/Arduino/pull/5504#pullrequestreview-186145820
* Move functions out of IRAM when possible
umm_init() is called in OS startup after flash is enabled, and never
again.
cont_get_free_stack() shouldn't be called from IRQ.
Don't inline _iram_read_byte() function.
* Move system fault handler to flash, use new printf
The __wrap_system_restart call has been in flash for quite a while and
seems to be working fine. There were some support routines that were
placed in IRAM (mistakenly thinking the wrap_restart caller was also in
IRAM) which are now moved to flash.
Clean up the printf code to use the new stdlib which handles PGM_P
strings as format and arguments without any difficulty.
* Make STR macro more unique
Add double-underscores to some string assistance macros to avoid
conflicts with user applications.
* Use function, not macro, to save code space
Save ~2KB final bin size by using a ets_printf_P function and not
an inline macro. IRAM and HEAP unaffected.
* Don't actually touch the SP in the dump
Store a copy of the incoming stack pointer in the postmortem in order
to avoid actually changing the SP when a crash happend in BearSSL.
* Make C++ uncaught exceptions explicit
Use the term "Unhandled C++ exception" instead of just "Unhandled
exception" to make it clear such crashes are caused by a C++ throw
and now a system exception.
* ci: fix checking for presence of CI_GITHUB_API_KEY
CI_GITHUB_API_KEY is always set when evaluating job include/exclude conditions, and it only gets removed when the job starts. Move the check into the script.
* ci: split build jobs into separate shell scripts