summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-23drivers/wiznet5k: Remove old Wiznet driver.robert-hh
It has been replaced by the submodule lib/wiznet5k.
2022-08-23tools/ci.sh: Split the stm32 builds for wiznet5k and cc3k.robert-hh
- Add lib/wiznet5k into the 'make submodules' step. - Split the stm32 builds for wiznet5k and cc3k. - Run 'make .... clean' after making the wiznet5k build.
2022-08-23stm32/mphalport: Add mp_hal_get_spi_obj() helper function.robert-hh
The function spi_from_mp_obj() is kept since it is used by the cc3k driver.
2022-08-23stm32: Add definitions required for lwIP version of Wiznet NIC.robert-hh
2022-08-23stm32: Switch Wiznet to use lib/wiznet5k and extmod/network_wiznet5k.robert-hh
Instead of the old Wiznet driver in drivers/wiznet5k.
2022-08-23mpy-cross,unix: Include alloca.h for NetBSD.Chris Waggoner
2022-08-23py/builtinimport: Allow overriding of mp_builtin___import__.Laurens Valk
This allows ports to override mp_builtin___import__. This can be useful in MicroPython applications where MICROPY_ENABLE_EXTERNAL_IMPORT has to be disabled due to its impact on build size (2% to 2.5% of the minimal port). By overriding the otherwise very minimal mp_builtin___import__, ports can still allow limited forms of application-specific imports. Signed-off-by: Laurens Valk <laurens@pybricks.com>
2022-08-23py: Clean up formatting of union definitions.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2022-08-23shared/runtime/sys_stdio_mphal: Make func static and remove some TODOs.Damien George
stdio_obj_print is private to this file so can be made static. The __del__ method does nothing so can be removed (it's only called by the GC if it exists, so if it doesn't exist it won't be called). And FileIO doesn't support a constructor in MicroPython at this stage. Signed-off-by: Damien George <damien@micropython.org>
2022-08-22javascript: Rename this port to 'webassembly'.Nicholas H.Tollervey
2022-08-19extmod/modframebuf: Improve poly-fill boundary pixels.Jim Mussared
Rather than drawing the entire boundary to catch missing pixels, just detect the cases where boundary pixels are skipped during node calculation and pre-emptively draw them then. This adds 72 bytes on PYBV11, but makes filled poly() 20% faster. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-19extmod/modframebuf: Add polygon drawing methods.Mat Booth
Add method for drawing polygons. For non-filled polygons, uses the existing line-drawing code to render arbitrary polygons using the given coords list, at the given x,y position, in the given colour. For filled polygons, arbitrary closed polygons are rendered using a fast point-in-polygon algorithm to determine where the edges of the polygon lie on each pixel row. Tests and documentation updates are also included. Signed-off-by: Mat Booth <mat.booth@gmail.com>
2022-08-19extmod/modframebuf: Add ellipse drawing method.Peter Hinch
2022-08-19extmod/modframebuf: Add fill argument to rect().Jim Mussared
We plan to add `ellipse` and `poly` methods, but rather than having to implement a `fill_xyz` version of each, we can make them take an optional fill argument. This commit add this to `rect` as a starting point. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-19py/dynruntime: Add mp_obj_is_true.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-19extmod/modframebuf: Optimise argument handling.Jim Mussared
Several methods extract mp_int_t from adjacent arguments. This reduces code size for the repeated calls to mp_obj_get_int. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18tools/mpremote: Add "edit" command.Jim Mussared
This allows a remote file to be edited locally by copying it over, running the local editor, then copying it back. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18tools/pyboard.py: Add "touch" filesystem command.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18tools/mpremote: Allow + terminator for fs commands.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-18all: Remove MICROPY_PY_IO_FILEIO config option.Damien George
Since commit e65d1e69e88268145ff0e7e73240f028885915be there is no longer an io.FileIO class, so this option is no longer needed. This option also controlled whether or not files supported being opened in binary mode (eg 'rb'), and could, if disabled, lead to confusion as to why opening a file in binary mode silently did the wrong thing (it would just open in text mode if MICROPY_PY_IO_FILEIO was disabled). The various VFS implementations (POSIX, FAT, LFS) were the only places where enabling this option made a difference, and in almost all cases where one of these filesystems were enabled, MICROPY_PY_IO_FILEIO was also enabled. So it makes sense to just unconditionally enable this feature (ability to open a file in binary mode) in all cases, and so just remove this config option altogether. That makes configuration simpler and means binary file support always exists (and opening a file in binary mode is arguably more fundamental than opening in text mode, so if anything should be configurable then it should be the ability to open in text mode). Signed-off-by: Damien George <damien@micropython.org>
2022-08-18extmod/vfs_posix_file: Remove unused MICROPY_VFS_POSIX_FILE.Damien George
This was made obsolete by 2b409ef8a46015f8f3bd20bc44e644637dbe9bd3 Signed-off-by: Damien George <damien@micropython.org>
2022-08-18tests,tools: Update path to unix micropython executable.Damien George
These were missed by 47c84286e8c8d9873e99f12711a683ecd6b9ca62 Signed-off-by: Damien George <damien@micropython.org>
2022-08-17unix/modusocket: Support proto and flags arguments to getaddrinfo.Efi Weiss
Signed-off-by: Efi Weiss <efiwiss@gmail.com>
2022-08-17docs/esp32: Fix string quoting consistency in SDCard mount example.David Peake
It appears that strings in the documentation are typically single quoted.
2022-08-15nrf,stm32: Don't enable debug info by default if LTO is on.Angus Gratton
It seems sometimes gcc with LTO will generate otherwise valid assembly listings that cause 'as' to error out when generating DWARF debug info; see https://sourceware.org/bugzilla/show_bug.cgi?id=29494 Therefore, don't enable -g by default if LTO is on. Enabling LTO=1 DEBUG=1 is still possible but may result in random errors at link time due to 'as' (the error in this case is "Error: unaligned opcodes detected in executable segment", and the only other easy workaround is CFLAGS+=-fno-jump-tables which may increase code size significantly). Follows on from fdfe4eca745dce5f20fb65a3c197006b9053999a
2022-08-12py/formatfloat: Use pow(10, e) instead of pos/neg_pow lookup tables.Dan Ellis
Rework the conversion of floats to decimal strings so it aligns precisely with the conversion of strings to floats in parsenum.c. This is to avoid rendering 1eX as 9.99999eX-1 etc. This is achieved by removing the power- of-10 tables and using pow() to compute the exponent directly, and that's done efficiently by first estimating the power-of-10 exponent from the power-of-2 exponent in the floating-point representation. Code size is reduced by roughly 100 to 200 bytes by this commit. Signed-off-by: Dan Ellis <dan.ellis@gmail.com>
2022-08-12py/parsenum: Ensure that trailing zeros lead to identical results.Dan Ellis
Prior to this commit, parsenum would calculate "1e-20" as 1.0*pow(10, -20), and "1.000e-20" as 1000.0*pow(10, -23); in certain cases, this could make seemingly-identical values compare as not equal. This commit watches for trailing zeros as a special case, and ignores them when appropriate, so "1.000e-20" is also calculated as 1.0*pow(10, -20). Fixes issue #5831.
2022-08-12extmod/modlwip: Add support for leaving multicast groups.MrJake222
2022-08-12extmod/uasyncio: Rename internal _flag to state, to save a qstr.Damien George
Saves about 16 bytes of flash when uasyncio is frozen in. Signed-off-by: Damien George <damien@micropython.org>
2022-08-12extmod/uasyncio: Add clear method to ThreadSafeFlag.Ned Konz
This is useful in situations where the ThreadSafeFlag is reused and needs to be cleared of any previous, unwanted event. For example, clear the flag at the start of an operation, trigger the operation (eg an I2C write), then (a)wait for an external event to set the flag (eg a pin IRQ). Further events may trigger the flag again but these are unwanted and should be cleared before the next cycle starts.
2022-08-12py/mkrules: Use abspath to find directory for mpy-cross dependency.Damien George
Otherwise if the `mpy-cross/build/` directory doesn't exist then `mpy-cross/build/..` won't work. Signed-off-by: Damien George <damien@micropython.org>
2022-08-12py/objstr: Remove str function object declarations from header file.Damien George
Since f7f56d42851aaff2027e23a8ca45c1f1973f1aca consolidated all uses of these to a single locals dict, they no longer need to be made public. Signed-off-by: Damien George <damien@micropython.org>
2022-08-12mpy-cross,unix: Remove .gitignore file.Damien George
Now that all build artefacts are placed in a build/ directory the gitignore is no longer needed. Signed-off-by: Damien George <damien@micropython.org>
2022-08-12tests/extmod/ubinascii: Add tests for bytes.hex etc.Jim Mussared
Also make the sep test not micropython-specific. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-12py/objstr: Add hex/fromhex to bytes/memoryview/bytearray.Jim Mussared
These were added in Python 3.5. Enabled via MICROPY_PY_BUILTINS_BYTES_HEX, and enabled by default for all ports that currently have ubinascii. Rework ubinascii to use the implementation of these methods. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-11zephyr/machine_uart: Use mp_obj_str_get_str to get device name.Damien George
This checks that the argument is actually a string. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11nrf/modules/ubluepy: Use mp_obj_str_get_data to extract str data.Damien George
Instead of GET_STR_DATA_LEN, which is intended to be a private macro. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11py/objstr: Consolidate methods for str/bytes/bytearray/array.Andrew Leech
This commit adds the bytes methods to bytearray, matching CPython. The existing implementations of these methods for str/bytes are reused for bytearray with minor updates to match CPython return types. For details on the CPython behaviour see https://docs.python.org/3/library/stdtypes.html#bytes-and-bytearray-operations The work to merge locals tables for str/bytes/bytearray/array was done by @jimmo. Because of this merging of locals the change in code size for this commit is mostly negative: bare-arm: +0 +0.000% minimal x86: +29 +0.018% unix x64: -792 -0.128% standard[incl -448(data)] unix nanbox: -436 -0.078% nanbox[incl -448(data)] stm32: -40 -0.010% PYBV10 cc3200: -32 -0.017% esp8266: -28 -0.004% GENERIC esp32: -72 -0.005% GENERIC[incl -200(data)] mimxrt: -40 -0.011% TEENSY40 renesas-ra: -40 -0.006% RA6M2_EK nrf: -16 -0.009% pca10040 rp2: -64 -0.013% PICO samd: +148 +0.105% ADAFRUIT_ITSYBITSY_M4_EXPRESS
2022-08-11py/qstr: Change qstr hash type from mp_uint_t to size_t.Damien George
The hash is either 8 or 16 bits (depending on MICROPY_QSTR_BYTES_IN_HASH) so will fit in a size_t. This saves 268 bytes on the unix nanbox build. Non-nanbox configurations are unchanged because mp_uint_t is the same size as size_t. Signed-off-by: Damien George <damien@micropython.org>
2022-08-11windows/Makefile: Update test dependency on $(PROG).Jim Mussared
PR #9012 (b2e82402688b53829f37475583231b067b9faea7) changed the output to $(BUILD)/$(PROG) but the tests are still looking for $(PROG). Also remove the now-unnecessary override of $(PROG) in the standard variant. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-11drivers/sdcard: Add delay in init_card_v1 to make timeout work.Kyuchumimo
This now follows how init_card_v2 works.
2022-08-11docs/library/rp2: Fix pull_thresh docs to use pull instead of push.Nathan Hendler
2022-08-11docs: Update links for Arm GCC toolchain.David Lechner
The separate A and RM toolchains have been discontinued and replaced by a single toolchain. This updates the links to the RM toolchain to the new toolchain. Signed-off-by: David Lechner <david@pybricks.com>
2022-08-11rp2: Correctly determine path to arm-none-eabi-size.Jacob Siverskog
Figure out path to arm-none-eabi-size the same way it's done for the other binaries, instead of assuming it to be in the user's $PATH. Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2022-08-11rp2: Mark gc_heap NOLOAD for faster boot.Phil Howard
Create a new linker section .unitialized_bss for bss that does not need zero-initialising. Move gc_heap to this section, which saves ~30ms from rising edge of RESET to setting a pin HIGH in MicroPython. Zero fill happens in Pico SDK crt0.S before ROSC is configured. It's very, very slow. Signed-off-by: Phil Howard <phil@gadgetoid.com>
2022-08-11rp2/boards/W5500_EVB_PICO: Add new board definition for W5500_EVB_PICO.omogenot
Signed-off-by: github@mymeterinfo.info
2022-08-11unix/modjni: Add missing const qualifier.David Yang
2022-08-11minimal/Makefile: Avoid terminal reset, use BUILD variable.Daniel Jour
stty can provide the current terminal settings, so that they can be stored in a shell variable and restored after running the firmware. This avoids the complete "blanking" of the terminal, and thus also removes the need for the sleep call. The run target now references the firmware file using the BUILD variable instead of using the hard coded "build/" path.
2022-08-11py/nlrpowerpc: Fix generation of ppc64 code on ppc32 build.Efi Weiss
Due to inline assembly, wrong instructions were generated. Use corresponding 32 bit instructions and fix the offsets used. Signed-off-by: Efi Weiss <efiwiss@gmail.com>
2022-08-11py/dynruntime.mk: Allow building assembly source in natmods.Mat Booth
Allow inclusion of assembly source files in dynamic native modules.