This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root
pointers in the renesas-ra port.
Signed-off-by: David Lechner <david@pybricks.com>
pyb_hid_report_desc is not used anywhere in the renesas-ra port (probably
was copied from stm32 port).
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register keyboard_interrupt_obj
and removes the same from mpconfigport.h.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root
pointers in the esp2866 port.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register all port-specific root
pointers for the cc3200 port.
Signed-off-by: David Lechner <david@pybricks.com>
mp_const_user_interrupt was listed as a root pointer but not used anywhere
in the code base, so it can be removed.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register mod_network_nic_list and
removes the same from all mpconfigport.h.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register bluetooth_nimble_memory
and bluetooth_nimble_root_pointers and removes the same from all
mpconfigport.h.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register
bluetooth_btstack_root_pointers and removes the same from all
mpconfigport.h.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register mp_wifi_spi, mp_wifi_timer
and mp_wifi_sockpoll_list and removes the same from all mpconfigport.h.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register mmap_region_head and
removes the same from mpconfigport.h.
Signed-off-by: David Lechner <david@pybricks.com>
This uses MP_REGISTER_ROOT_POINTER() to register the readline_history root
pointer array used by shared/readline.c and removes the registration from
all mpconfigport.h files.
This also required adding a new MICROPY_READLINE_HISTORY_SIZE config option
since not all ports used the same sized array.
Signed-off-by: David Lechner <david@pybricks.com>
This adds new compile-time infrastructure to parse source code files for
`MP_REGISTER_ROOT_POINTER()` and generates a new `root_pointers.h` header
file containing the collected declarations. This works the same as the
existing `MP_REGISTER_MODULE()` feature.
Signed-off-by: David Lechner <david@pybricks.com>
Some devices, such as the LightBlue BTLE app on iOS, try to use Bluetooth 5
when connecting to a device. This means that they will send a
BLE_GAP_EVT_PHY_UPDATE_REQUEST message to shift to a new physical layer.
If this event isn't handled, LightBlue (and likely other Bluetooth 5.0
central devices) will try to connect and then fail, staying in
"Connecting..." state forever. This message should be replied to with
sd_ble_gap_phy_update, as documented in
drivers/bluetooth/s140_nrf52_6.1.1/s140_nrf52_6.1.1_API/include/ble_gap.h.
This commit handles the event. LightBlue can now successfully connect to a
BTLE device on a P10059 nRF52840 dongle running MicroPython. Two other
related events have logging added in case they are needed in the future.
Commit 0e28a1f0e5 made it possible to set
-march=armv6m. It needs to be used when freezing for rp2.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Since nlr_jump_fail() exits the process, it can leave the terminal in raw
mode which means characters are not echoed. Fix this by restoring the
original terminal mode.
Signed-off-by: David Lechner <david@pybricks.com>
When a flash write/erase is in progress, we need to ensure that the
other core cannot be using XIP.
This also implements MICROPY_BEGIN_ATOMIC_SECTION as a full mutex, which
is necessary as it's used to syncronise access to things like the scheduler
queue.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
The goal is to avoid a situation where core 1 is shut down while holding
the tinyusb spinlock, which could happen during soft reset if
mp_thread_deinit is called while core1 is running tud_task().
This also fixes a latent race where the two cores are competing to
decrement and compare `vm_hook_divisor` with no mem fence or atomic
protection -- only core0 will now do this.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
To override it a board must define MICROPY_BOARD_FATAL_ERROR to a function
that takes a string message and does not return.
Signed-off-by: Damien George <damien@micropython.org>
The file `ports/unix/moduos.c` uses `errno` so it needs to include
`errno.h`, otherwise a compiler error can occur.
Signed-off-by: David Lechner <david@pybricks.com>
Ensure that nimble and cyw43-driver are initialised when the board requires
it. Also make these work with `make submodules`.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Commit 9670a156da missed one renaming of
MICROPY_PY_WIZNET5K to MICROPY_PY_NETWORK_WIZNET5K which prevented the
Wiznet interface from being enabled.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>