aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-01-31py/modthread: Fix spelling error in comment.David Lechner
2020-01-31esp8266/modules/ntptime.py: Add comment about configuring NTP host.Damien George
The ability to change the host is a frequently requested feature, so explicitly document how it can be achieved using the existing code. See issues #2121, #4385, #4622, #5122, #5536.
2020-01-31stm32/powerctrl: Reenable PLL3 on H7 MCUs when waking from stop mode.Damien George
So that USB can work.
2020-01-31stm32/powerctrl: Improve support for changing system freq on H7 MCUs.Damien George
This commit improves pllvalues.py to generate PLL values for H7 MCUs that are valid (VCO in and out are in range) and extend for the entire range of SYSCLK values up to 400MHz (up to 480MHz is currently unsupported).
2020-01-31stm32/stm32_it: Don't call __HAL_USB_HS_EXTI_CLEAR_FLAG on H7 MCUs.Damien George
It doesn't exist on these MCUs.
2020-01-31stm32/sdio: Add support for H7 MCUs.Damien George
The cyw43 driver on stm32 will now work with H7 MCUs.
2020-01-31drivers/cyw43: Return early from cyw43_wifi_set_up if wifi_on fails.Damien George
2020-01-31drivers/cyw43: Include stdio.h in files that use printf.Damien George
2020-01-30stm32/boards/stm32f746_af.csv: Add ADC alt functions to correct pins.Damien George
2020-01-30stm32/powerctrl: Enable overdrive on F7 when waking from stop mode.Damien George
Because if the SYSCLK is set to 180MHz or higher it will require this to be on already.
2020-01-30stm32/powerctrl: Disable HSI if not needed to save a bit of power.Damien George
2020-01-30tests/basics: Expand test cases for equality of subclasses.Nicko van Someren
2020-01-30py: Support non-boolean results for equality and inequality tests.Nicko van Someren
This commit implements a more complete replication of CPython's behaviour for equality and inequality testing of objects. This addresses the issues discussed in #5382 and a few other inconsistencies. Improvements over the old code include: - Support for returning non-boolean results from comparisons (as used by numpy and others). - Support for non-reflexive equality tests. - Preferential use of __ne__ methods and MP_BINARY_OP_NOT_EQUAL binary operators for inequality tests, when available. - Fallback to op2 == op1 or op2 != op1 when op1 does not implement the (in)equality operators. The scheme here makes use of a new flag, MP_TYPE_FLAG_NEEDS_FULL_EQ_TEST, in the flags word of mp_obj_type_t to indicate if various shortcuts can or cannot be used when performing equality and inequality tests. Currently four built-in classes have the flag set: float and complex are non-reflexive (since nan != nan) while bytearray and frozenszet instances can equal other builtin class instances (bytes and set respectively). The flag is also set for any new class defined by the user. This commit also includes a more comprehensive set of tests for the behaviour of (in)equality operators implemented in special methods.
2020-01-30py/objtype: Make mp_obj_type_t.flags constants public, moved to obj.h.Damien George
2020-01-30stm32/boards/STM32F769DISC: Add config to use external SPI as filesys.Damien George
This board now has the following 3 build configurations: - mboot + external QSPI in XIP mode + internal filesystem - mboot + external QSPI with filesystem (the default) - no mboot + external QSPI with filesystem
2020-01-30stm32/Makefile: Allow a board's .mk file to add things to CFLAGS.Damien George
2020-01-30drivers, stm32: Support SPI/QSPI flash chips over 16MB.Andrew Leech
With a SPI flash that has more than 16MB, 32-bit addressing is required rather than the standard 24-bit. This commit adds support for 32-bit addressing so that the SPI flash commands (read/write/erase) are selected automatically depending on the size of the address being used at each operation.
2020-01-29py/mpthread.h: Use strong type for mp_thread_set_state() argument.David Lechner
This modifies the signature of mp_thread_set_state() to use mp_state_thread_t* instead of void*. This matches the return type of mp_thread_get_state(), which returns the same value. `struct _mp_state_thread_t;` had to be moved before `#include <mpthreadport.h>` since the stm32 port uses it in its mpthreadport.h file.
2020-01-29stm32/powerctrl: For F7, allow PLLM!=HSE when setting PLLSAI to 48MHz.Damien George
PLLM is shared among all PLL blocks on F7 MCUs, and this calculation to configure PLLSAI to have 48MHz on the P output previously assumed that PLLM is equal to HSE (eg PLLM=25 for HSE=25MHz). This commit relaxes this assumption to allow other values of PLLM.
2020-01-27py/nativeglue: Fix typo about where the native fun table enum is.Jim Mussared
2020-01-27py/emitnative: Stop after finding an unwind target.Jim Mussared
The loop searches backwards for a target, but doesn't stop after finding the first result, meaning that it'll always end up at the outermost exception handler.
2020-01-27py/emitnative: Use NULL for pending exception (not None).Jim Mussared
This previously made the native emitter incompatible with the bytecode emitter, and mp_resume (and subsequently mp_obj_generator_resume) expects the bytecode emitter behavior (i.e. throw==NULL).
2020-01-27tests: Add tests for generator throw and yield-from with exc handlers.Jim Mussared
This commit adds a generator test for throwing into a nested exception, and one when using yield-from with a pending exception cleanup. Both these tests currently fail on the native emitter, and are simplified versions of native test failures from uasyncio in #5332.
2020-01-26unix/unix_mphal: Add compile check for incompatible GIL+ASYNC_KBD_INTR.David Lechner
It is not safe to enable MICROPY_ASYNC_KBD_INTR and MICROPY_PY_THREAD_GIL at the same time. This will trigger a compiler error to ensure that it is not possible to make this mistake.
2020-01-26windows/windows_mphal: Release GIL during system calls.David Lechner
This releases the GIL during syscalls that could block.
2020-01-26py: Release GIL during syscalls in reader and writer code.David Lechner
This releases the GIL during POSIX system calls that could block.
2020-01-26extmod/vfs_posix: Release GIL during system calls.David Lechner
This releases the GIL during syscalls that could block.
2020-01-26unix: Release GIL during all system calls.David Lechner
Addition of GIL EXIT/ENTER pairs are: - modos: release the GIL during system calls. CPython does this as well. - moduselect: release the GIL during the poll() syscall. This call can be blocking, so it is important to allow other threads to run at this time. - modusocket: release the GIL during system calls. Many of these calls can be blocking, so it is important to allow other threads to run. - unix_mphal: release the GIL during the read and write syscalls in mp_hal_stdin_rx_chr and mp_hal_stdout_tx_strn. If we don't do this threads are blocked when the REPL or the builtin input function are used. - file, main, mpconfigport.h: release GIL during syscalls in built-in functions that could block.
2020-01-24unix/Makefile: Reserve CFLAGS_EXTRA/LDFLAGS_EXTRA for external use.Damien George
When CFLAGS_EXTRA/LDFLAGS_EXTRA (or anything) is set on the command line of a make invocation then it will completely override any setting or appending of these variables in the makefile(s). This means builds like the coverage variant will have their mpconfigvariant.mk settings overridden. Fix this by using CFLAGS/LDFLAGS exclusively in the makefile(s), reserving the CFLAGS_EXTRA/LDFLAGS_EXTRA variables for external command-line use only.
2020-01-24tests: Add boolean-as-integer formatting tests for fixed regression.Yonatan Goldschmidt
As suggested by @dpgeorge in #5538.
2020-01-24tests/unix: Add coverage tests for mp_obj_is_type() and variants.Yonatan Goldschmidt
2020-01-24py/obj.h: Add and use mp_obj_is_bool() helper.Yonatan Goldschmidt
Commit d96cfd13e3a464862cecffb2718c6286b52c77b0 introduced a regression in testing for bool objects, that such objects were in some cases no longer recognised and bools, eg when using mp_obj_is_type(o, &mp_type_bool), or mp_obj_is_integer(o). This commit fixes that problem by adding mp_obj_is_bool(o). Builds with MICROPY_OBJ_IMMEDIATE_OBJS enabled check if the object is any of the const True or False objects. Builds without it use the old method of ->type checking, which compiles to smaller code (compared with the former mentioned method). Fixes #5538.
2020-01-23tests/unix: Add coverage test for mp_obj_new_exception_args.Damien George
Because it's no longer called anywhere in the code.
2020-01-23py/objexcept: Optimise mp_obj_new_exception[_arg1/_args] functions.Damien George
This reduces code size by 10-70 bytes on all ports (except cc3200 which has no change).
2020-01-23py/objgenerator: Use mp_obj_new_exception_arg1 to make StopIteration.Damien George
2020-01-23py/qstr: Don't include or init qstr_mutex when GIL is enabled.David Lechner
When threads and the GIL are enabled, then the qstr mutex is not needed. The qstr_mutex field is never used in this case because of: #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL #define QSTR_ENTER() mp_thread_mutex_lock(&MP_STATE_VM(qstr_mutex), 1) #define QSTR_EXIT() mp_thread_mutex_unlock(&MP_STATE_VM(qstr_mutex)) #else #define QSTR_ENTER() #define QSTR_EXIT() #endif So, we can completely remove qstr_mutex everywhere when MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL.
2020-01-23py/gc: Don't include or init gc_mutex when GIL is enabled.David Lechner
When threads and the GIL are enabled, then the GC mutex is not needed. The gc_mutex field is never used in this case because of: #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL #define GC_ENTER() mp_thread_mutex_lock(&MP_STATE_MEM(gc_mutex), 1) #define GC_EXIT() mp_thread_mutex_unlock(&MP_STATE_MEM(gc_mutex)) #else #define GC_ENTER() #define GC_EXIT() #endif So, we can completely remove gc_mutex everywhere when MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL.
2020-01-23tools/pydfu.py: Clean up syntax, update comments and docstrings.c0rejump
Some parts of code have been aligned to increase readability. In general '' instead of "" were used wherever possible to keep the same convention for entire file. Import inspect line has been moved to the top according to hints reported by pep8 tools. A few extra spaces were removed, a few missing spaces were added. Comments have been updated, mostly in "read_dfu_file" function. Some other comments have been capitalized and/or slightly updated. A few docstrings were fixed as well. No real code changes intended.
2020-01-23tools: Add metrics.py script to build and compute port sizes/metrics.Damien George
2020-01-22tests/unix: Add coverage tests for pairheap data structure.Damien George
2020-01-22tests/extmod: Add basic machine.Timer test.Damien George
2020-01-22stm32/softtimer: Change linear linked list to a pairing heap.Damien George
2020-01-22py/pairheap: Add generic implementation of pairing heap data structure.Damien George
2020-01-22windows: Support word-based move/delete key sequences for REPL.stijn
Translate common Ctrl-Left/Right/Delete/Backspace to the EMACS-style sequences (i.e. Alt key based) for forward-word, backward-word, forwad-kill and backward-kill. Requires MICROPY_REPL_EMACS_WORDS_MOVE to be defined so the readline implementation interprets these.
2020-01-22esp32/modnetwork: Add max_clients kw-arg to WLAN.config for AP setting.adzierzanowski
This allows the user to configure the maximum number of clients that are connected to the access point. Resolves #5125.
2020-01-22docs/library/uos.rst: Improve block devices section, and ioctl ret vals.Peter Hinch
2020-01-22tests: Make run-tests help and README be more descriptive of behaviour.Thorsten von Eicken
2020-01-15esp32: Enable NimBLE support on all builds (IDF 3.3 and 4.0).Jim Mussared
This commit updates the IDFv3 version to v3.3.1, and enables the "ubluetooth" module by default on IDFv3 builds.
2020-01-14esp8266/modules: Fix AttributeError in _boot.py if flash not formatted.JensDiemer
Prior to this commit, if the flash filesystem was not formatted then it would error: "AttributeError: 'FlashBdev' object has no attribute 'mount'". That is due to it not being able to detect the filesystem on the block device and just trying to mount the block device directly. This commit fixes the issue by just catching all exceptions. Also it's not needed to try the mount if `flashbdev.bdev` is None.
2020-01-14ports: Modify mp_hal_pin_write macro so it can be used as a function.Memiks
Even though it doesn't return anything it could still be used like a function. Addresses issue #5501.