Currently <WLAN>.isconnected() always returns True if a static IP is set,
regardless of the state of the connection.
This patch introduces a new flag 'wifi_sta_connected' which is set in
event_handler() when GOT_IP event is received and reset when DISCONNECTED
event is received (unless re-connect is successful). isconnected() now
simply returns the status of this flag (for STA_IF).
The pre-existing flag misleadingly named 'wifi_sta_connected" is also
renamed to 'wifi_sta_connect_requested'.
Fixes issue #3837
They are now efficient (in runtime performance) and provide a useful
feature that's hard to obtain without them enabled.
See issue #3644 and PR #3826 for background.
This patch adds support for building the firmware with external SPI RAM
enabled. It is disabled by default because it adds overhead (due to
silicon workarounds) and reduces performance (because it's slower to have
bytecode and objects stored in external RAM).
To enable it, either use "make CONFIG_SPIRAM_SUPPORT=1", or add this line
to you custom makefile/GNUmakefile (before "include Makefile"):
CONFIG_SPIRAM_SUPPORT = 1
When this option is enabled the MicroPython heap is automatically allocated
in external SPI RAM.
Thanks to Angus Gratton for help with the compiler and linker settings.
- Updated supported git hash to current IDF version.
- Added missing targets and includes to Makefile.
- Updated error codes for networking module.
- Added required constant to sdkconfig configuration.
If a socket is cleanly shut down by the peer then reads on this socket
should continue to return zero bytes. The lwIP socket API does not have
this behaviour (it only returns zero once, then blocks on subsequent calls)
so this patch adds explicit checks and logic for peer closed sockets.
Add --init to the submodule update example, thus, all submodules get
initialised including the nested (--recursive) ones. Without it there
might not be a submodule init.
The esp8266 uses modlwip.c for its usocket implementation, which allows to
easily support callbacks on socket events (like when a socket becomes ready
for reading). This is not as easy to do for the esp32 which uses the
ESP-IDF-provided lwIP POSIX socket API. Socket events are needed to get
WebREPL working, and this patch provides a way for such events to work by
explicitly polling registered sockets for readability, and then calling the
associated callback if the socket is readable.
This event queue has UART events posted to it and they need to be drained
for it to operate without error. The queue is not used by the uPy UART
class so it should be removed to prevent the IDF emitting errors.
Fixes#3704.
This patch moves the implementation of stream closure from a dedicated
method to the ioctl of the stream protocol, for each type that implements
closing. The benefits of this are:
1. Rounds out the stream ioctl function, which already includes flush,
seek and poll (among other things).
2. Makes calling mp_stream_close() on an object slightly more efficient
because it now no longer needs to lookup the close method and call it,
rather it just delegates straight to the ioctl function (if it exists).
3. Reduces code size and allows future types that implement the stream
protocol to be smaller because they don't need a dedicated close method.
Code size reduction is around 200 bytes smaller for x86 archs and around
30 bytes smaller for the bare-metal archs.
This patch takes the software SPI implementation from extmod/machine_spi.c
and moves it to a dedicated file in drivers/bus/softspi.c. This allows the
SPI driver to be used independently of the uPy runtime, making it a more
general component.
Currently only the first 2 args are used, but this patch should at least
make getaddrinfo() signature-compatible with CPython and other bare-metal
ports that use the lwip bindings.