* works
* fixup! works
* back to callbacks
* names
* daisy chain
* seconds
* less inline
* fix dns setter
* might as well keep using initlist
/to d-a-v it has automatic storage, here it's the same stack based one
(just one less line for us)
* shift blame
* naming
* fix impl
* revert to ip4 dns
* merge fix
* restyle
* masking done wrong
* Initialize SoftAP DhcpServer object on demand
Remove dependency on global ctor, and just construct the object when
someone asks us to do it. Only dependency right now is netif_git, which
is expected to be initialized by the lwip code some time before
dhcps_start happens.
Removing ip_info from begin(), since we never reference later on.
Also removing the specific check for netif id and simplify the ctors.
Update tests and recover old nonos-sdk dhcps functions that were not implemented.
* nonos helpers have a separate header
* wifi ap needs this anyway, simplify sketch includes
* missing example
* existing name :/
* trying to fix header dependency
* restyle
* not a c header
* no need to init
* move dhcp server getter to WiFi
more... arduino'ish? we ahve object as namespace, plus everything else
related to softAP is there
redundant includes, redundant mock impl (out-of-scope here to fix)
* ...move things back, still expose as WiFi method
* review fix
* include -nonos header in wifi lib though
* no more lwip include
* style
* need mock dhcpserver instance
* Define lwIP's s32/u32 to int
s32/u32 were previously defined as long,
but long can be 64 bits in host mode,
so this commit reduces valgrind complaints and increase coherency.
* some lads like to use `unsigned long` for 32 bits IPv4 addresses
* fix lwIP's `sys_now()` return type
* fix C declarations
* merge upstream (lwip2) update on sys_now() definition
* matching lwIP api (2/2)
Co-authored-by: Max Prokhorov <prokhorov.max@outlook.com>
* Add support to specify global build defines and options
A script manages the use of a file with a unique name, like
`SketchName.ino.globals.h`, in the Sketch source directory to provide compiler
command-line options (build options) and sketch global defines. The build
option data is encapsulated in a unique "C" comment block and extracted into
the build tree during prebuild.
* Applied os.path.normpath() liberally to input arguments. Fixes windows file path issue.
Improved helpful message for adding embedded build options.
* doubleup '\'
* Added context help for build option support
* expunged sketchbook global
added workaround for aggressive caching
* inital pass at searching for and reading preferences.txt
* Correct Windows path for preferences.txt
Added portable path for preferences.txt
Expanded file timestamp granularity
Improved error message printing for Arduino IDE 2.0 RC4
* Improved portable path and various Windows paths to preferences.txt
* Add cleanup logic and identify 1st run after IDE restart
* text corrections
* Create mkbuildoptglobals.py
When global header file does not exist, this print makes it easier for user to create the header file by providing its name and documentation pointer.
* build.opt heads up to user
Compiler command line changes from build.opt are shown to user
* Updated text
* oops
* Expanded comment and made print help consistent
* Improve handling stderr/stdout with "no verbose output"
Grouped helpful info to print at the end.
Added missing return value.
* Correct timestamp on CommonHFile.h
More improvements to printing
Updated docs.
* Added command-line parser
Support hints for compiler.cache_core. For use when Arduino IDE uses
command-line options that override compiler.cache_core.
Removed overuse of ()
Improve FAQ entry
* Fix script failure under windows
Rely on argpaser for checking that all arguments are present.
Removed redundant argument check in main().
Added '--debug' option and print_dbg method.
Rethink failures on overrides. Remove well know path fallbacks,
error exit when override file is missing.
In well-known path search for preferences.txt, do not assume true.
Make failure to find an error exit event.
When Windows has two preferences.txt files and they have different
values for caching and globals.h is used, error exit. It is not
possible to know from the script which is being used.
* Use quotes on build.opt
Update comment
Include the @ within the expantion string use quotes around file name.
Update doc example to remind and use quotes.
* Update CI for build option and global support
Added "mkbuildoptglobals.extra_flags=--cache_core" to platform.loca.txt
Update "-ide-version=10802" this version number indicates aggressive caching support
Added example to test global .h support
* Add debug prints
Added --debug to CI - this needs to be removed later
Tweaks to touch...
* Give each build VM a unique build.tmp space
* Corrected style on example
temp CI changes
debug crud
Added --ci switch
* Removed CI debug crud
run_CI_locall.sh works fine locally. Hosted Multi-VM CI fails
to work with 'aggressive caching' workaround method.
Add #if defined(CORE_MOCK) to failing example.
* Try HOST_MOCK
* CI adjustments
mkbuildoptglobals.py is optimized around the Arduino IDE 1.x
behaviour. One way the CI differs from the Arduino IDE is in the
handling of core and caching core. With the Arduino IDE, each sketch
has a private copy of core and contributes to a core cache. With the
CI, there is one shared copy of core for all sketches. When global
options are used, the shared copy of core and cache are removed before
and after the build.
* Doc update
The key functions added are:
`bool enableForwarder(const String &domainName=emptyString, const IPAddress &dns=uint32_t)0)`
If specified, `enableForwarder` will update the `domainName` that is used to match DNS request to this AP's IP Address. A non-matching request will be forwarded to the DNS server specified by `dns`.
Returns `true` on success.
Returns `false`,
* when forwarding `dns` is not set, or
* unable to allocate resources for managing the DNS forward function.
`void disableForwarder(const String &domainName=emptyString, bool freeResources=false)`
`disableForwarder` will stop forwarding DNS requests. If specified, updates the `domainName` that is matched for returning this AP's IP Address.
Optionally, resources used for the DNS forward function can be freed.
Avoid blowing up user code when `$user:$password` string is longer than
127 bytes. Use String to both manage the memory and handle concatenation.
Also clean-up historical quicks such as
- `if(StringObject)` that is always true since we implemented SSO
- `authReq = "";` / `authReq = String();`, which will happen anyway
- `(String)...` casts that happen anyway, implicitly (and which is also not a 'cast' btw, we do init it)
* emulation on host: minor fixes
merge MockDigital.cpp and HostWiring.cpp
* emulation: share mockverbose between CI-on-host and emulation
* mock: add missing recently overridden method
* remove extern variable, use weak function
The existing ESP8266SdFat points to a working branch of the tree.
That branch is now merged to master, so move library to it.
There are no code changes,
* Fix VM Address mask
Adjust VM Address mask to allow up to 8M Byte parts.
Allow for free heap size values over 64K
ESP.getHeapStats(, uint32_t,)
uint32_t getMaxFreeBlockSize();
* Fix example
* Update MockEsp.cpp for uint32_t on EspClass::getMaxFreeBlockSize()
* Added comment about heap size limitation and static_assert to verify.
Updated boards.txt to show correct External memory size and Heap size.
* WiFiServer - 'rename' available() to accept()
* use server.accept() instead of available()
* WiFiServer.accept() and ArduinoWiFiServer class doc update
* Enable I2C_BUFFER_LENGTH definition for Wire lib
Based on
375a89ed58
We should have been very careful when #defining things to not use a name
that could conflict with the user's own code, so this marks that old
define as deprecated.
If you opt-into the new behavior, you do not get the old BUFFER_LENGTH
constant.
As a bonus, changing these uint8_ts to size_t both reduces the code
size & improves performance.
* Increase buffer indexing variable size
I looked over the users of these variables and they should be fine with
no additional changes. The existing methods already have an option to
use size_t rather than uint8_t.
There's a few methods which return int instead of size_t, which isn't
great from a portability perspective but will be fine since this only is
designed to run on the ESP8266.
* Remove warnings, errors during host tests in CI
Debug strings often included format parameters which did not exactly match
the passed in format parameters, resulting in warnings in the host test build
process like
````
/home/runner/work/Arduino/Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp:107:20: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
107 | DEBUG_WIFI("[AP] SSID length %u, too long or missing!\n", ssid_len);
| ~~~~~~~~
| |
| size_t {aka long unsigned int}
````
Fix by applying casting or PRxxx macros as appropriate.
Also, fix one debug message which was trying to use a `String` as a `char *`:
````
/home/runner/work/Arduino/Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp: In member function ‘wl_status_t ESP8266WiFiMulti::connectWiFiMulti(uint32_t)’:
/home/runner/work/Arduino/Arduino/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp:331:34: warning: format ‘%s’ expects argument of type ‘char*’, but argument 3 has type ‘String’ [-Wformat=]
331 | DEBUG_WIFI_MULTI("[WIFIM] Connecting %s\n", ssid);
````
* Clean up SpeedTest.ino host build
* EspSoftwareSerial 6.14.0: Add API for selecting Rx GPIO PULLUP at runtime.
* EspSoftwareSerial: bug fix 6.14.1: Set default RX pullup once in ctor, prevents flipping of that state on begin().
* ESP8266WebServer - drop current HC_WAIT_READ connection sooner when another has data
Safari sometimes opens two connections when loading a page and only
sends a request over the second one, resulting in a 5 second wait
(HTTP_MAX_DATA_WAIT) before the request is processed. This commit
drops the current connection after 30ms (HTTP_MAX_DATA_AVAILABLE_WAIT)
when there is a new connection with data available or the buffer of
pending TCP clients is full (currently 5).
Use a formatting function to give more human-readable output formats
for flash bandwidth. When the test starts and ends in less than one
millisecond, report as "Infinite".
Sample output:
````
Creating 512KB file, may take a while...
==> Time to write 512KB in 256b chunks = 6641 milliseconds
==> Created file size = 524288
Reading 512KB file sequentially in 256b chunks
==> Time to read 512KB sequentially in 256b chunks = 211 milliseconds = 2.48 MB/s
Reading 512KB file MISALIGNED in flash and RAM sequentially in 256b chunks
==> Time to read 512KB sequentially MISALIGNED in flash and RAM in 256b chunks = 212 milliseconds = 2.47 MB/s
Reading 512KB file in reverse by 256b chunks
==> Time to read 512KB in reverse in 256b chunks = 367 milliseconds = 1.43 MB/s
Writing 64K file in 1-byte chunks
==> Time to write 64KB in 1b chunks = 1249 milliseconds = 52.47 KB/s
Reading 64K file in 1-byte chunks
==> Time to read 64KB in 1b chunks = 296 milliseconds = 221.41 KB/s
````
esp_yield() now also calls esp_schedule(), original esp_yield() function renamed to esp_suspend().
Don't use delay(0) in the Core internals, libraries and examples. Use yield() when the code is
supposed to be called from CONT, use esp_yield() when the code can be called from either CONT or SYS.
Clean-up esp_yield() and esp_schedule() declarations across the code and use coredecls.h instead.
Implement helper functions for libraries that were previously using esp_yield(), esp_schedule() and
esp_delay() directly to wait for certain SYS context tasks to complete. Correctly use esp_delay()
for timeouts, make sure scheduled functions have a chance to run (e.g. LwIP_Ethernet uses recurrent)
Related issues:
- #6107 - discussion about the esp_yield() and esp_delay() usage in ClientContext
- #6212 - discussion about replacing delay() with a blocking loop
- #6680 - pull request introducing LwIP-based Ethernet
- #7146 - discussion that originated UART code changes
- #7969 - proposal to remove delay(0) from the example code
- #8291 - discussion related to the run_scheduled_recurrent_functions() usage in LwIP Ethernet
- #8317 - yieldUntil() implementation, similar to the esp_delay() overload with a timeout and a 0 interval
- =default for default ctor, destructor, move ctor and the assignment move
- use `std::unique_ptr<WiFiClient>` instead of raw pointer to the client
- implement `virtual std::unique_ptr<WiFiClient> WiFiClient::clone()` to safely copy the WiFiClientSecure instance, without accidentally slicing it (i.e. using the pointer with incorrect type, calling base WiFiClient virtual methods)
- replace headers pointer array with `std::unique_ptr<T[]>` to simplify the move operations
- substitute userAgent with the default one when it is empty
(may be a subject to change though, b/c now there is a global static `String`)
Allow HTTPClient to be placed inside of movable classes (e.g. std::optional, requested in the linked issue) or to be returned from functions. Class logic stays as-is, only the underlying member types are changed.
Notice that WiFiClient connection object is now copied, and the internal ClientContext will be preserved even after the original WiFiClient object was destroyed.
replaces #8236resolves#8231
and, possibly #5734
These changes are needed to address bugs that can emerge with the improved optimization from the GCC 10.3 compiler.
Updated performance inline functions `mmu_get_uint8()`, ... and `mmu_set_uint8()`, ... to comply with strict-aliasing rules.
Without this change, stale data may be referenced. This issue was revealed in discussions on https://github.com/esp8266/Arduino/issues/8261#issue-963529268
Changes to avoid over-optimization of 32-bit wide transfers from IRAM, turning into 8-bit or 16-bit transfers by the new GCC 10.3 compiler. This has been a reoccurring/tricky problem for me with the new compiler.
So far referencing the 32-bit value loaded by way of an Extended ASM R/W output register has stopped the compiler from optimizing down to an 8-bit or 16-bit transfer.
Example:
```cpp
uint32_t val;
__builtin_memcpy(&val, v32, sizeof(uint32_t));
asm volatile ("" :"+r"(val)); // inject 32-bit dependency
...
```
Updated example `irammem.ino`
* do a simple test of compliance to strict-aliasing rules
* For `mmu_get_uint8()`, added tests to evaluate if 32-bit wide transfers were converted to an 8-bit transfer.