This removes the duplicate code in cyw43, esp32, esp8266 that implements
the same logic as network.hostname.
Renames the `mod_network_hostname` (where we store the hostname value in
`.data`) to `mod_network_hostname_data` to make way for calling the shared
function `mod_network_hostname`.
And uses memcpy for mod_network_hostname_data, because the length of source
is already known and removes reliance on string data being null-terminated.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This changes from the previous limit of 15 characters. Although DHCP and
mDNS allow for up to 63, ESP32 and ESP8266 only allow 32, so this seems
like a reasonable limit to enforce across all ports (and avoids wasting the
additional memory).
Also clarifies that `MICROPY_PY_NETWORK_HOSTNAME_MAX_LEN` does not include
the null terminator (which was unclear before).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Update the documentation in circuitpython/shared-bindings/rotaryio/IncrementalEncoder.c
to explicitly state that rotaryio.IncrementalEncoder assumes the encoder's pins are
connected to ground and sets pull-ups on the pins accordingly.
Closes#5847
Signed-off-by: Sumitra Sharma <sumitraartsy@gmail.com>
This patch reinstalls the pin IRQ handler on WiFi init, as some
ports disable/remove pin IRQs on soft-reboot, or deinit the pins.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
The following code:
server = await asyncio.start_server(...)
async with server:
... code that raises ...
would lose the original exception because the server's task would not have
had a chance to be scheduled yet, and so awaiting the task in wait_closed
would raise the cancellation instead of the original exception.
Additionally, ensures that explicitly cancelling the parent task delivers
the cancellation correctly (previously was masked by the server loop), now
this only happens if the server was closed, not when the task was
cancelled.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
By clearing the tamper bits and enabling access to the registers for all
code, just in case that this was set. It keeps the clock running on
battery and the calibration setting.
Signed-off-by: robert-hh <robert@hammelrath.com>
Not all boards or BLE extensions have the flow control signals for BLE
available at suitable pins. Actually none of the Adafruit extensions
match for flow control.
For consistency with the previous behaviour it is enabled by default.
Signed-off-by: robert-hh <robert@hammelrath.com>
Commit 552b0bbe12 did not define
MICROPY_PY_MACHINE_SDCARD properly, and thus building the firmware failed.
Signed-off-by: robert-hh <robert@hammelrath.com>
There is a single UART clock for all devices, so switching it for one will
affect all devices used at that time. This commit fixes that issue by
keeping the clock at a fixed value.
This fixed clock still supports the common baud rates between 300 and
921600 baud.
Signed-off-by: robert-hh <robert@hammelrath.com>