Damien George
63f0e700f4
extmod/modure: Set subject begin_line so ^ doesn't match interior.
Fixes issue #8402 .
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
0149cd6b8b
windows: Switch to VFS subsystem and use VfsPosix.
Following the unix port.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
2b409ef8a4
unix/moduos: Convert module to use extmod version.
All variants now use extmod/moduos.c as their uos module implementation.
In particular this means they all have MICROPY_VFS enabled and use VfsPosix
for their filesystem.
As part of this, the available functions in uos become more consistent with
other ports:
- coverage variant gets uos.urandom
- minimal and standard variant get: unlink, chdir, getcwd, listdir
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
ade2720e55
esp8266/moduos: Convert module to use extmod version.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
11b77263ef
stm32/moduos: Convert module to use extmod version.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
818be10bb5
zephyr/moduos: Convert module to use extmod version.
This also adds uos.unlink(), for all ports that use extmod/moduos.c.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
1c53d85162
esp32/moduos: Convert module to use extmod version.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
926b554daf
extmod/moduos: Create general uos module to be used by all ports.
Based on the rp2 port version, with the rp2 port converted to use this
module.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Daniël van de Giessen
e2513bfe8d
extmod/moduzlib: Fix parsing zlib header dict size.
From RFC 1950 section 2.2: "CINFO is the base-2 logarithm of the LZ77
window size, minus eight (CINFO=7 indicates a 32K window size)"
Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
4 years ago
stijn
49934fcf8b
extmod/moduplatform: Move platform PP definitions into a header.
These are more generally useful than just for the module so make them
globally available, prefixed consistently with MICROPY_PLATFORM_.
3 years ago
iabdalkader
465b74e78d
drivers/ninaw10: Add NIC-level ioctl function.
This commit adds support in the driver for irregular commands. It
currently supports setting GPIO pin mode, and GPIO pin read/write value.
3 years ago
Christian Decker
2e3a2785cd
extmod/modubinascii: Add newline keyword to b2a_base64 function.
This allows encoding things (eg a Basic-Auth header for a request) without
slicing the \n from the string, which allocates additional memory.
Co-authored-by: David Lechner <david@lechnology.com>
3 years ago
Damien George
7d71ae25ed
extmod/machine_i2c: Increase default SoftI2C timeout to 50ms.
Some devices, eg BNO055, can stretch SCL for a long time, so make the
default large to accommodate them. 50ms matches the current default for
stm32 hardware I2C .
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
9438fb7321
extmod/modusocket: Support additional args to getaddrinfo.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
iabdalkader
1aac151d68
drivers/ninaw10: Return standard error numbers.
3 years ago
iabdalkader
a63875d5ad
extmod/modusocket: Create new sockets in blocking mode.
To conform with CPython and other MicroPython ports.
3 years ago
iabdalkader
155eb1361e
extmod/modusocket: Add makefile() method and common socket options.
3 years ago
iabdalkader
b23178a9c0
extmod/modusocket: Make setsockopt return if NIC is not connected.
3 years ago
iabdalkader
e401ff8935
drivers/ninaw10: Fix timeout handling to match modusocket.
3 years ago
iabdalkader
9a61bc3aa7
extmod/network_ninaw10: Implement MP_STREAM_POLL in ioctl.
There is currently no function to query if the socket is writable.
3 years ago
Damien George
e7fff736b5
extmod/modbluetooth: Put declaration of connect_cancel in correct place.
This fixes a bug introduced in 851ecb2da1
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Damien George
889dee8076
extmod/modbluetooth: Fix conditional compilation of ringbuf_put_uuid.
This fixes a bug introduced in a76604afba
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
iabdalkader
f2ccf87e0b
extmod/network_ninaw10: Use socket timeout preset in modusocket.
3 years ago
iabdalkader
842da93011
extmod/modusocket: Initialise accepted socket state.
3 years ago
iabdalkader
67420de4f4
extmod/modusocket: Allow setting timeout on unbound sockets.
For an extended state socket, if settimeout() is called before a NIC is
bound, save the timeout until the NIC is bound.
3 years ago
Damien George
3243abfda2
extmod/moduplatform: Detect xtensa arch.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
iabdalkader
5a86031223
extmod/network_ninaw10: Make recv/recvfrom interchangeable.
3 years ago
iabdalkader
73a6b53dbe
extmod/network_ninaw10: Return -1 on timeout from recv/send.
3 years ago
iabdalkader
544c232eb7
extmod/network_ninaw10: Make NIC state persistent.
3 years ago
iabdalkader
0f25e0387c
extmod/network_ninaw10: Disable active connections before connecting.
3 years ago
iabdalkader
1b7eee24eb
extmod/network_ninaw10: Fix config of AP mode.
* Fix missing call to connect to configure module in AP mode.
* Use enum for config/connect args indices.
3 years ago
Damien George
efde4b2c75
extmod/modure: Redirect regex debug printing to mp_printf.
Signed-off-by: Damien George <damien@micropython.org>
3 years ago
Jim Mussared
3770fab334
all: Update Python formatting to latest Black version 21.12b0.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
3 years ago
Jonathan Hogg
851ecb2da1
extmod/modbluetooth: Support gap_connect(None) to cancel a connection.
Allow cancellation of in-progress peripheral connections.
3 years ago
iabdalkader
f7a0c98e00
extmod/network_ninaw10: Fix scan list order to match other NICs.
3 years ago
stijn
5900257dd6
extmod/uplatform: Use generic custom platform string.
Don't force the 'HAL' string to be part of the platform string because
it doesn't have a sensible meaning for all possible platforms, and
swap it with the PLATFORM_ARCH string so the strings which most platforms
have come first.
3 years ago
stijn
1e5875557a
extmod/uplatform: Remove unused definitions.
3 years ago
Damien George
43d08688c3
extmod/uasyncio: Fix gather returning exceptions from a cancelled task.
Fixes issue #5882 .
3 years ago
iabdalkader
43079aaf86
drivers/ninaw10: Add ublox Nina-W10 WiFi/BT module driver.
- Add WiFi/BT drivers for ublox Nina-W10 (esp32 based) module.
- Add ublox Nina-W10 Python module in extmod.
3 years ago
Jim Mussared
9519484c56
extmod/nimble: Remove workaround for OS_ENOMEM.
This was fixed in NimBLE 1.4.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
3 years ago
Jim Mussared
948e3289bf
extmod/nimble: Update to NimBLE v1.4.
We're using the MicroPython fork of NimBLE, which on the
`micropython_1_4_0` branch re-adds support for 64-bit targets and fixes
initialisation of g_msys_pool_list.
Also updates modbluetooth_nimble.c to suit v1.4.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
3 years ago
Jim Mussared
43467b9c71
extmod/modbluetooth: Add connection interval to gap_connect.
This forwards through directly to the NimBLE and BTStack connect functions.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
3 years ago
Andrew Leech
2ceeabf180
extmod/vfs_posix_file: Support MP_STREAM_POLL in vfs_posix_file_ioctl.
Allows asyncio reading of sys.stdin when MICROPY_PY_USELECT is used in the
build configuration.
3 years ago
stijn
d42cba0d22
extmod/moduplatform: Improve implementation for PC ports.
Fix identification of 32/64 bit and of the Windows platform and add a
platform string mimicking CPython for the latter.
3 years ago
iabdalkader
2c5e9bbdfa
extmod: Add platform module.
It contains the compiler version, and underlying system HAL/SDK version.
3 years ago
iabdalkader
38f8e852e0
rp2: Add framework for networking.
MICROPY_PY_NETWORK and MICROPY_PY_USOCKET need to be enabled by a board to
get networking. No NICs have yet been defined.
3 years ago
iabdalkader
8064c3bf9c
extmod/nimble: Add nimble CMake fragment file.
3 years ago
iabdalkader
80f2c794e6
extmod/mpbthci.h: Add mp_bluetooth_hci_uart_any prototype.
This allows drivers to use mpbthciport functions to read/write/poll UART.
3 years ago
iabdalkader
d9749f90ad
extmod/modnetwork: Remove modnetwork socket u_state member.
To simplify the socket state.
The CC3K driver (see drivers/cc3000/inc/socket.h and src/socket.c) has
socket() returning an INT16 so there is now enough room to store it
directly in the fileno member.
3 years ago
iabdalkader
f9d573a4ac
extmod/modnetwork: Remove STM32 references.
3 years ago