- 25 7月, 2023 4 次提交
-
-
由 Damien George 提交于
Otherwise constructing an invalid SPI instance (eg machine.SPI(3)) will mess up machine.SPI(2)'s state before it's detected that it's an invalid SPI id. Signed-off-by: NDamien George <damien@micropython.org>
-
由 Damien George 提交于
On ESP32C3 it's not doing anything. On ESP32S3 the original code prevented prevented machine.SPI(1) from working. Signed-off-by: NDamien George <damien@micropython.org>
-
由 Damien George 提交于
Signed-off-by: NDamien George <damien@micropython.org>
-
由 Damien George 提交于
SPI3_HOST is not a macro but rather an enum, so use SOC_SPI_PERIPH_NUM to detect if it's defined. Fixes issue #11919. Signed-off-by: NDamien George <damien@micropython.org>
-
- 24 7月, 2023 9 次提交
-
-
由 Jim Mussared 提交于
Previously this was explicitly enabled on esp32/stm32/renesas/mimxrt/samd, but didn't get a default feature level because it wasn't in py/mpconfig.h. With this commit it's now enabled at the "extra features" level, which adds rp2, unix-standard, windows, esp8266, webassembly, and some nrf boards. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Armin Brauns 提交于
This way, a bare `-` is never interpreted as an option, even before `--`. Filenames starting with `-` still need to be put after `--`. Signed-off-by: NArmin Brauns <armin.brauns@embedded-solutions.at>
-
由 Armin Brauns 提交于
Unless -o is given, output defaults to stdout unless a source file is given (in which case the source file name is used to derive an output file name). Signed-off-by: NArmin Brauns <armin.brauns@embedded-solutions.at>
-
由 Armin Brauns 提交于
Signed-off-by: NArmin Brauns <armin.brauns@embedded-solutions.at>
-
由 Armin Brauns 提交于
Signed-off-by: NArmin Brauns <armin.brauns@embedded-solutions.at>
-
由 Daniël van de Giessen 提交于
This changes the ESP32 WDT implementation to use a custom handle so that it becomes possible to reset the WDT from a thread. By default esp_task_wdt_add subscribes the task_id of the current task. That means that if we're running in a different task we are unable to reset the WDT, which prevents feeding the WDT from a thread directly, or even from a timer (which may randomly run in a different task when there's multiple threads). As an added bonus, the name we set makes the error clearly specify that it was the user-specified WDT that reset the chip. Signed-off-by: NDaniël van de Giessen <daniel@dvdgiessen.nl>
-
由 Daniël van de Giessen 提交于
Since commit beeb74 we already check in modussl_mbedtls whether this function is provided by the ESP-IDF before calling it, thus we no longer need to define it here in order to compile. Removing it so that if CONFIG_MBEDTLS_DEBUG is defined we do not cause any 'multiple definition' compile errors. Signed-off-by: NDaniël van de Giessen <daniel@dvdgiessen.nl>
-
由 iabdalkader 提交于
Signed-off-by: Niabdalkader <i.abdalkader@gmail.com>
-
由 Damien George 提交于
When MICROPY_SCHEDULER_STATIC_NODES is enabled, the logic is unchanged. When MICROPY_SCHEDULER_STATIC_NODES is disable, sched_state is now always initialised to MP_SCHED_IDLE when calling mp_init(). For example, the use of mp_sched_vm_abort(), if it aborts a running scheduled function, can lead to the scheduler starting off in a locked state when the runtime is restarted, and then it stays locked. This commit fixes that case by resetting sched_state. Signed-off-by: NDamien George <damien@micropython.org>
-
- 21 7月, 2023 14 次提交
-
-
由 Jim Mussared 提交于
This replaces the previous zlib version. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
Also update zlib & gzip docs to describe the micropython-lib modules. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
This provides similar functionality to the former zlib.DecompIO and especially CPython's gzip.GzipFile for both compression and decompression. This class can be used directly, and also can be used from Python to implement (via io.BytesIO) zlib.decompress and zlib.compress, as well as gzip.GzipFile. Enable/disable this on all ports/boards that zlib was previously configured for. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
For better abstraction for users of this API. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
Collapsing the two adjacent calls to outbits saves 32 bytes. Bringing defl_static.c into lz77.c allows better inlining, saves 24 bytes. Merge the Outbuf/uzlib_lz77_state_t structs, a minor simplification that doesn't change code size. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
Saves 68 bytes on PYBV11. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
This supports `wbits` values between +40 to +47. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
This library used a mix of "tinf" and "uzlib" to refer to itself. Remove all use of "tinf" in the public API. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
This commit makes the following changes: - Replace 256-byte reverse-bits-in-byte lookup table with computation. - Replace length and distance code lookup tables with computation. - Remove comp_disabled check (it's unused). - Make the dest_write_cb take the data pointer directly, rather than the Outbuf. Saves 500 bytes on PYBV11. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
Because we only use the streaming source, this is just extra code size. Saves 64 bytes on PYBV11. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Damien George 提交于
The compression algorithm implemented in this commit uses much less memory compared to the standard way of implementing it using a hash table and large look-back window. In particular the algorithm here doesn't allocate hash table to store indices into the history of the previously seen text. Instead it simply does a brute-force-search of the history text to find a match for the compressor. This is slower (linear search vs hash table lookup) but with a small enough history (eg 512 bytes) it's not that slow. And a small history does not impact the compression too much. To give some more concrete numbers comparing memory use between the approaches: - Standard approach: inplace compression, all text to compress must be in RAM (or at least memory addressable), and then an additional 16k bytes RAM of hash table pointers, pointing into the text - The approach in this commit: streaming compression, only a limited amount of previous text must be in RAM (user selectable, defaults to 512 bytes). To compress, say, 1k of data, the standard approach requires all that data to be in RAM, plus an additional 16k of RAM for the hash table pointers. With this commit, you only need the 1k of data in RAM. Or if it's streaming from a file (or elsewhere), you could get away with only 256 bytes of RAM for the sliding history and still get very decent compression. In summary: because compression takes such a large amount of RAM (in the standard algorithm) and it's not really suitable for microcontrollers, the approach taken in this commit is to minimise RAM usage as much as possible, and still have acceptable performance (speed and compression ratio). Signed-off-by: NDamien George <damien@micropython.org>
-
由 Jim Mussared 提交于
There are enough places that implement __exit__ by forwarding directly to mp_stream_close that this saves code size. For the cases where __exit__ is a no-op, additionally make their MP_STREAM_CLOSE ioctl handled as a no-op. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
由 Jim Mussared 提交于
This will be replaced with a new deflate module providing the same functionality, with an optional frozen Python wrapper providing a replacement zlib module. binascii.crc32 is temporarily disabled. This work was funded through GitHub Sponsors. Signed-off-by: NJim Mussared <jim.mussared@gmail.com>
-
- 20 7月, 2023 13 次提交
-
-
由 Mark Grosen 提交于
The EXTRA_COMPONENT_DIRS variable is a list so adding a directory so should be done via append, not set. This enables boards to use other components in the build. See: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#optional-project-variables
-
由 Luca Burelli 提交于
Signed-off-by: NLuca Burelli <l.burelli@arduino.cc>
-
由 Luca Burelli 提交于
On targets that provide a reference TinyUSB implementation, like ESP32, the SDK already defines and implements standard callback functions such as tud_cdc_line_state_cb(). This causes a symbol clash when enabling shared implementations like the MicroPython 1200 touch functionality. To avoid this symbol clash, add an optional macro to allow ports to use a different function name in the shared implementation. Signed-off-by: NLuca Burelli <l.burelli@arduino.cc>
-
由 Luca Burelli 提交于
Allow boards to define their own additional USB callbacks. Signed-off-by: NLuca Burelli <l.burelli@arduino.cc>
-
由 Luca Burelli 提交于
Implement a standard machine.bootloader() method for ESP32-series devices. No default implementation, each board can enable it as required. Signed-off-by: NLuca Burelli <l.burelli@arduino.cc>
-
由 Luca Burelli 提交于
Some targets like the ESP32-S3 use the IDF Component Manager to provide additional dependencies to the build. Make sure to include these extra components when collecting properties used by MicroPython-specific build steps, like qstr preprocessing. Signed-off-by: NLuca Burelli <l.burelli@arduino.cc>
-
由 Angus Gratton 提交于
Re-enable some features required for the board to still build and the lora driver to run. This board only has 192KB of flash total, so default stm32 build is very close to the limit. Before: LINK build-B_L072Z_LRWAN1/firmware.elf text data bss dec hex filename 184352 68 14112 198532 30784 build-B_L072Z_LRWAN1/firmware.elf (12256 bytes free) After: LINK build-B_L072Z_LRWAN1/firmware.elf text data bss dec hex filename 155028 68 14052 169148 294bc build-B_L072Z_LRWAN1/firmware.elf (41580 bytes free) This work was funded through GitHub Sponsors. Signed-off-by: NAngus Gratton <angus@redyak.com.au>
-
由 Angus Gratton 提交于
Includes fixing the SCK connection pin. This work was funded through GitHub Sponsors. Signed-off-by: NAngus Gratton <angus@redyak.com.au>
-
由 Damien George 提交于
This adds named-pins support to the esp32 port, following other ports. Since the name of esp32 CPU pins is just GPIOx, where x is an integer, the Pin.cpu dict is not supported and CPU pins are just retrieved via their existing integer "name" (the cost of adding Pin.cpu is about 800 bytes, mostly due to the additional qstrs). What this commit supports is the Pin.board dict and constructing a pin by names given by a board. These names are defined in a pins.csv file at the board level. If no such file exists then Pin.board exists but is empty. As part of this commit, pin and pin IRQ objects are optimised to reduce their size in flash (by removing their gpio_num_t entry). The net change in firmware size for this commit is about -132 bytes. Signed-off-by: NDamien George <damien@micropython.org>
-
由 robert-hh 提交于
Sometimes mp_hal_get_pin_obj() was used. machine_pin_find() is the internal name, and the external interface is mp_hal_get_pin_obj(). Signed-off-by: Nrobert-hh <robert@hammelrath.com>
-
由 robert-hh 提交于
Allowing the machine.pwm() and esp.apa102() module to accept Pin(x) integer parameters. Not so much of a gain, just consistent with other ports. Signed-off-by: Nrobert-hh <robert@hammelrath.com>
-
由 robert-hh 提交于
This applies to all machine modules which have pins as arguments. Since machine_pin_get_id() calls pin_find(), these pin arguments may be at the moment either integer objects or Pin objects. That allows for instance to write uart = UART(1, tx=Pin(4), rx=Pin(5)) instead of uart = UART(1, tx=4, rx=5) which is consistent with other ports. Since this handling is done at a single place in the code, extending that scheme to accept strings for named pins is easy. Signed-off-by: Nrobert-hh <robert@hammelrath.com>
-
由 robert-hh 提交于
The new machine_pin_find() function accepts a Pin object and a integer object as input and returns a pin object. That can be extended later to accept a string object, once named pins are supported. Signed-off-by: Nrobert-hh <robert@hammelrath.com>
-