Age | Commit message (Collapse) | Author |
|
It is hopefully more reliable.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
Array equality is defined as each element being equal but to keep
code size down MicroPython implements a binary comparison. This
can only be used correctly for elements with the same binary layout
though so turn it into an NotImplementedError when comparing types
for which the binary comparison yielded incorrect results: types
with different sizes, and floating point numbers because nan != nan.
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
A board can now customise mboot with:
- MBOOT_LED1, MBOOT_LED2, MBOOT_LED3, MBOOT_LED4: if it needs to have
different LEDs for mboot compared to the application
- MBOOT_BOARD_LED_INIT: if it needs a fully customised LED init function
- MBOOT_BOARD_LED_STATE: if it needs a fully customised LED state-setting
function
- MBOOT_BOARD_GET_RESET_MODE: if it needs a fully customised function to
get the reset mode
With full customisation, the only requirement is a single LED to show the
status of the bootloader (idle, erasing, flashing, etc), which can be
configured to do nothing if needed.
Signed-off-by: Damien George <damien@micropython.org>
|
|
It is enabled by default to get the standard behaviour of doing a reset
after it is finished, but can be disabled by a board to jump straight to
the application (likely the board needs to use MBOOT_BOARD_CLEANUP to make
this work).
The application is passed a reset mode of BOARDCTRL_RESET_MODE_BOOTLOADER
if the bootloader was active and entered via a jump.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This new logic is equivalent to the old logic when the only possibilities
for reset_mode are NORMAL, SAFE_MODE and FILESYSTEM, which is the standard
case. But the new logic also allows other reset_mode values (eg
BOOTLOADER) to run boot.py and main.py.
Signed-off-by: Damien George <damien@micropython.org>
|
|
When disabled the bootloader is entered via a direct jump. When enabled
the bootloader is entered via a system reset then a jump. It's enabled by
default to retain the existing behaviour, which is the recommended way.
Signed-off-by: Damien George <damien@micropython.org>
|
|
If the user sets V or BUILD_VERBOSE then they don't need to see this
message.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
This was broken by 8459f538eb45fd8e1e4d614298449cf18de84d75
Signed-off-by: Damien George <damien@micropython.org>
|
|
This can be a replacement for a UART in custom ports.
|
|
So the TinyUSB headers can be found during qstr processing.
Fixes issue #7236.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This was broken by 32ec07a3504d6dcbfc53997197a3c53e8c03497f
|
|
Based on original commit made by Seon Rozenblum aka @UnexpectedMaker.
Signed-off-by: Damien George <damien@micropython.org>
|
|
And add default hardware SPI 0 pins in mpconfigboard.h, and
CONFIG_LWIP_LOCAL_HOSTNAME in sdkconfig.board.
|
|
Improvements made:
- PSRAM support for S2
- partition definition for 16MiB flash
- correct ADC and DAC pins
- correct GPIO and IRQ pins
- S3 components in CMakeLists
Based on original commit made by Seon Rozenblum aka @UnexpectedMaker.
Signed-off-by: Damien George <damien@micropython.org>
|
|
The RP2040 has 2 cores and supports running at most 2 Python threads (the
main one plus another), and will raise OSError if a thread cannot be
created because core1 is already in use. This commit adjusts some thread
tests to be robust against such OSError's. These tests now pass on rp2
boards.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This commit makes gc_lock_depth have one counter per thread, instead of one
global counter. This makes threads properly independent with respect to
the GC, in particular threads can now independently lock the GC for
themselves without locking it for other threads. It also means a given
thread can run a hard IRQ without temporarily locking the GC for all other
threads and potentially making them have MemoryError exceptions at random
locations (this really only occurs on MCUs with multiple cores and no GIL,
eg on the rp2 port).
The commit also removes protection of the GC lock/unlock functions, which
is no longer needed when the counter is per thread (and this also fixes the
cas where a hard IRQ calling gc_lock() may stall waiting for the mutex).
It also puts the check for `gc_lock_depth > 0` outside the GC mutex in
gc_alloc, gc_realloc and gc_free, to potentially prevent a hard IRQ from
waiting on a mutex if it does attempt to allocate heap memory (and putting
the check outside the GC mutex is now safe now that there is a
gc_lock_depth per thread).
Signed-off-by: Damien George <damien@micropython.org>
|
|
Any code running on core1 should be stopped on soft-reset (the GC heap is
reset so if code continues to run on core1 it will see corrupt memory).
Signed-off-by: Damien George <damien@micropython.org>
|
|
This is a long-running test, so make it run in reasonable time on slower,
bare-metal ports.
Signed-off-by: Damien George <damien@micropython.org>
|
|
The esp32 port needs to be idle for finished threads and their resources to
be freed up.
Signed-off-by: Damien George <damien@micropython.org>
|
|
So a lock can be acquired on one Python thread and then released on
another. A test for this is added.
Signed-off-by: Damien George <damien@micropython.org>
|
|
Because vPortCleanUpTCB runs on the FreeRTOS idle task and cannot execute
any VM or runtime related code like freeing memory.
Signed-off-by: Damien George <damien@micropython.org>
|
|
All the method signatures from rp2_pio.c and friends have been taken and
converted to RST format, then explanatory notes added for each signature.
Signed-off-by: Tim Radvan <tim@tjvr.org>
|
|
And clean up (make more efficient) display set-up commands.
|
|
Or unset entries will have garbage in them.
Signed-off-by: mishafarms <github@mishafarms.us>
|
|
|
|
|
|
|
|
|
|
uctypes.FLOAT32 has a special value representation and
uctypes_struct_scalar_size() should be used instead of GET_SCALAR_SIZE().
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
Signed-off-by: Damien George <damien@micropython.org>
|
|
They are no longer used, and the text in the docs is more up to date.
Signed-off-by: Damien George <damien@micropython.org>
|
|
This fixes a bug where double arguments on a 32-bit architecture would not
be passed correctly because they only had 4 bytes of storage (not 8). It
also fixes a compiler warning/error in return_ffi_value on certian
architectures: array subscript 'double[0]' is partly outside array bounds
of 'ffi_arg[1]' {aka 'long unsigned int[1]'}.
Fixes issue #7064.
Signed-off-by: Damien George <damien@micropython.org>
|
|
To match other ports.
Signed-off-by: Damien George <damien@micropython.org>
|
|
|
|
|
|
|
|
In the STM32 HAL libraries, the default value for LSI_VALUE for F4 MCUs is
32 kHz.
Signed-off-by: David Lechner <david@pybricks.com>
|
|
|
|
This adds to the ESP8266 tutorial instructions explaining which pins to
pull low to enter programming mode.
Commit made originally by @ARF1 in #2910.
Signed-off-by: Damien George <damien@micropython.org>
|
|
See also https://github.com/esp8266/Arduino/issues/1624
|
|
The number shown in the USB id is now the same as that returned by
machine.unique_id(). All 8 bytes are inserted as hex into the USB id. A
usb id at /dev/serial/by-id then looks like:
usb-MicroPython_Board_in_FS_mode_e469b03567342f37-if00
|
|
|
|
|
|
Doing "import <tab>" will now complete/list built-in modules.
Originally at adafruit#4548 and adafruit#4608
Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
|
|
Originally at adafruit#4548
Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
|
|
Originally at adafruit#4548
Signed-off-by: Artyom Skrobov <tyomitch@gmail.com>
|