aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-11-28esp32/mpthreadport: Prevent deadlocks when deleting all threads.Damien George
vTaskDelete now immediately calls vPortCleanUpTCB, which requires the thread_mutex mutex, so vTaskDelete must be called after this mutex is released.
2018-11-28stm32/powerctrl: Disable IRQs during stop mode to allow reconfig on wakeDamien George
2018-11-28stm32/powerctrl: Move (deep)sleep funcs from modmachine.c to powerctrl.cDamien George
2018-11-28stm32/usb: Fully deinitialise USB periph when it is deactivated.Damien George
2018-11-28stm32/servo: Only initialise TIM5 if it is needed, to save power.Damien George
2018-11-27tools/pydfu.py: Improve DFU reset, and auto-detect USB transfer size.Damien George
A DFU device must be in the idle state before it can be programmed, and this requires either clearing the status or aborting, depending on its current state. Code is added to do this. And the USB transfer size is now automatically detected so devices with a size less than 2048 bytes work correctly.
2018-11-26tests/io: Update tests to use uos.remove() instead of uos.unlink().Paul Sokolovsky
After Unix port switches from one to another, to be consistent with baremetal ports.
2018-11-26unix/modos: Rename unlink to remove to be consistent with other ports.Paul Sokolovsky
We standardized to provide uos.remove() as a more obvious and user-friendly name. That's what written in the docs. The Unix port implementation predates this convention, so update it now.
2018-11-26stm32/flashbdev: Add missing include for irq.h.Michael Paul Coder
This is required for mboot to build.
2018-11-26stm32/adc: Add ADC auto-calibration for L4 MCUs.Tobias Badertscher
This increases the precision of the ADC.
2018-11-26py/unicode: Fix check for valid utf8 being stricter about contn chars.Damien George
2018-11-26README: Remove text about selecting different ports in the docs.Damien George
2018-11-15README: Remove references to "make axtls", it's no longer needed.Damien George
Since 0be2ea50e98f9d742b9611d0289853a11d9e7f53 axtls is automatically built as part of the usual "make" build process.
2018-11-01tests/import_long_dyn: Test for "import *" of a long dynamic name.Paul Sokolovsky
Such names aren't stored as qstr in module dict, and there was a bug in "import *" handling which assumed any name in a module dict is a qstr.
2018-11-01py/runtime: Fix qstr assumptions when handling "import *".Paul Sokolovsky
There was an assumption that all names in a module dict are qstr's. However, they can be dynamically generated (by assigning to globals()), and in case of a long name, it won't be a qstr. Handle this situation properly, including taking care of not creating superfluous qstr's for names starting with "_" (which aren't imported by "import *").
2018-11-01stm32/system_stm32: Introduce configuration defines for PLL3 settings.roland
A board must be able to set the PLL3 values based on the HSE that it uses.
2018-10-30tests/extmod: Skip uselect test when CPython doesn't have poll().stijn
CPython does not have an implementation of select.poll() on some operating systems (Windows, OSX depending on version) so skip the test in those cases instead of failing it.
2018-10-28py/scope: Optimise scope_find_or_add_id to not need "added" arg.Damien George
Taking the address of a local variable is mildly expensive, in code size and stack usage. So optimise scope_find_or_add_id() to not need to take a pointer to the "added" variable, and instead take the kind to use for newly added identifiers.
2018-10-28py/compile: Remove unneeded variable from global/nonlocal stmt helpers.Damien George
2018-10-28py/compile: Fix case of eager implicit conversion of local to nonlocal.Damien George
This ensures that implicit variables are only converted to implicit closed-over variables (nonlocals) at the very end of the function scope. If variables are closed-over when first used (read from, as was done prior to this commit) then this can be incorrect because the variable may be assigned to later on in the function which means they are just a plain local, not closed over. Fixes issue #4272.
2018-10-27tests/cmdline/cmd_showbc.py: Fix test to explicitly declare nonlocal.Damien George
The way it was written previously the variable x was not an implicit nonlocal, it was just a normal local (but the compiler has a bug which incorrectly makes it a nonlocal).
2018-10-27py/py.mk: When building axtls use -Wno-all to prevent all warnings.Damien George
Building axtls gives a lot of warnings with -Wall enabled, and explicitly disabling all of them cannot be done in a way compatible with gcc and clang, and likely other compilers. So just use -Wno-all to prevent all of the extra warnings (in addition to the necessary -Wno-unused-parameter, -Wno-uninitialized, -Wno-sign-compare and -Wno-old-style-definition). Fixes issue #4182.
2018-10-23tests/import: Add .exp file for module_getattr.py to not require Py 3.7.Damien George
2018-10-23examples/unix/ffi_example: Clean up and update the ffi example.Paul Sokolovsky
1. Use uctypes.bytearray_at(). Implementation of the "ffi" module predates that of "uctypes", so initially some convenience functions to access memory were added to ffi. Later, they landed in uctypes (which follows CPython's ctype module). So, replace undocumented experimental functions from ffi to documented ones from uctypes. 2. Use more suitable type codes for arguments (e.g. "P" (const void*) instead of "p" (void*). 3. Some better var naming. 4. Clarify some messages printed by the example.
2018-10-23docs/conf.py: Use https for intersphinx link to docs.python.org.Paul Sokolovsky
To get rid of warning when building the docs saying there's a redirect from http: to https:.
2018-10-23docs/library/uctypes: Add examples and make general updates.Paul Sokolovsky
Examples are added to the beginning of the module docs, similarly to docs for many other modules. Improvements to grammar, style, and clarity. Some paragraphs are updated with better suggestions. A warning added of the effect incorrect usage of the module may have. Describe the fact that offset range used in one defined structure is limited.
2018-10-23tests/extmod/uctypes_sizeof_layout: Test for sizeof of different layout.Paul Sokolovsky
On almost all realistic platforms, native layout should be larger (or equal) than packed layout.
2018-10-23extmod/moductypes: Make sizeof() accept "layout" parameter.Paul Sokolovsky
sizeof() can work in two ways: a) calculate size of already instantiated structure ("sizeof variable") - in this case we already no layout; b) size of structure decsription ("sizeof type"). In the latter case, LAYOUT_NATIVE was assumed, but there should possibility to calculate size for other layouts too. So, with this patch, there're now 2 forms: uctypes.sizeof(struct) uctypes.sizeof(struct_desc, layout)
2018-10-23py/objmodule: Implement PEP 562's __getattr__ for modules.Paul m. p. P
Configurable via MICROPY_MODULE_GETATTR, disabled by default. Among other things __getattr__ for modules can help to build lazy loading / code unloading at runtime.
2018-10-22tests: Make bytes/str.count() tests skippable.Paul Sokolovsky
2018-10-22py/objstr: Make str.count() method configurable.Paul Sokolovsky
Configurable via MICROPY_PY_BUILTINS_STR_COUNT. Default is enabled. Disabled for bare-arm, minimal, unix-minimal and zephyr ports. Disabling it saves 408 bytes on x86.
2018-10-19tools/pyboard.py: In TelnetToSerial.close replace try/except with if.Martin Dybdal
Some Python linters don't like unconditional except clauses because they catch SystemExit and KeyboardInterrupt, which usually is not the intended behaviour.
2018-10-19esp32/network_ppp: Add PPPoS functionality.Eric Poulsen
This commit adds network.PPP(stream) which allows to create a TCP/IP network interface over a stream object (eg a UART).
2018-10-19docs/pyb.Pin: Minor typo fix to specify Pin in pyb.Pin.cpu.Dave Hylands
2018-10-19esp32/modesp32: Add hall_sensor() function.Eric Poulsen
2018-10-19unix/Makefile: Allow to override/omit pthread lib name.Paul Sokolovsky
For example, on Android, pthread functions are part of libc, so LIBPTHREAD should be empty.
2018-10-18docs/uio: Document StringIO/BytesIO(alloc_size) constructors.Paul Sokolovsky
2018-10-18tests/basics/class_getattr: Remove invalid test for __getattribute__.Damien George
Part of this test was trying to test some functionality of __getattribute__ but this method name was misspelt so it wasn't doing anything useful. Fixing the typo in this name makes the test fail because MicroPython doesn't support user defined __getattribute__ methods. So this part of the test is removed. The remaining tests are modified slightly to make it clearer what they are testing.
2018-10-18py/objtype: Remove comment about catching exc from user __getattr__.Damien George
Any exception raised in a user __getattr__ should be propagated out. A test is added to verify these semantics.
2018-10-17extmod/modonewire: Fix reset timings to match 1-wire specs.Damien George
Fixes issue #4116.
2018-10-17stm32/boards/stm32h743.ld: Fix total flash size, should be 2048k.Damien George
Fixes issue #4240.
2018-10-17stm32/spi: Fix calculation of SPI clock source on H7 MCUs.iabdalkader
2018-10-17unix/modffi: Add support for "q"/"Q" specs (int64_t/uint64_t).Paul Sokolovsky
2018-10-17unix/modusocket: Finish socket.settimeout() implementation.Paul Sokolovsky
1. Return correct error code for non-blocking vs timed out socket (POSIX returns EAGAIN for both, we want ETIMEDOUT in case of timed out socket). To achieve this, blocking/non-blocking flag is added to the mp_obj_socket_t, to avoid issuing fcntl() syscall each time EAGAIN occurs. (mp_obj_socket_t used to be 8 bytes, having some room in a standard 16-byte alloc block.) 2. Handle socket.settimeout(0) properly - in Python, that means non-blocking mode, but SO_RCVTIMEO/SO_SNDTIMEO of 0 is infinite timeout. 3. Overall, make sure that socket.settimeout() call switches blocking state as expected.
2018-10-17unix/modusocket: Initial implementation of socket.settimeout().Danielle Madeley
2018-10-15stm32/usbd_cdc_interface: Refactor USB CDC tx code to not use SOF IRQ.Damien George
Prior to this commit the USB CDC used the USB start-of-frame (SOF) IRQ to regularly check if buffered data needed to be sent out to the USB host. This wasted resources (CPU, power) if no data needed to be sent. This commit changes how the USB CDC transmits buffered data: - When new data is first available to send the data is queued immediately on the USB IN endpoint, ready to be sent as soon as possible. - Subsequent additions to the buffer (via usbd_cdc_try_tx()) will wait. - When the low-level USB driver has finished sending out the data queued in the USB IN endpoint it calls usbd_cdc_tx_ready() which immediately queues any outstanding data, waiting for the next IN frame. The benefits on this new approach are: - SOF IRQ does not need to run continuously so device has a better chance to sleep for longer, and be more responsive to other IRQs. - Because SOF IRQ is off, current consumption is reduced by a small amount, roughly 200uA when USB is connected (measured on PYBv1.0). - CDC tx throughput (USB IN) on PYBv1.0 is about 2.3 faster (USB OUT is unchanged). - When USB is connected, Python code that is executing is slightly faster because SOF IRQ no longer interrupts continuously. - On F733 with USB HS, CDC tx throughput is about the same as prior to this commit. - On F733 with USB HS, Python code is about 5% faster because of no SOF. As part of this refactor, the serial port should no longer echo initial characters when the serial port is first opened (this only used to happen rarely on USB FS, but on USB HS is was more evident).
2018-10-15stm32/usbd_cdc_interface: Handle disconnect IRQ to set VCP disconnected.Damien George
pyb.USB_VCP().isconnected() will now return False if the USB is disconnected after having previously been connected. See issue #4210.
2018-10-15py/emitnative: Put None/False/True in global native const table.Damien George
So these constant objects can be loaded by dereferencing the REG_FUN_TABLE pointer instead of loading immediate values. This reduces the size of generated native code (when such constants are used), and means that pointers to these constants are no longer stored in the assembly code.
2018-10-15py/emitnative: Push internal None rather than const obj where possible.Damien George
This shifts the work of loading the constant None object on to load_reg_stack_imm(), making the handling of None more centralised.
2018-10-15py/emitnative: Simplify viper mode handling in emit_native_import_name.Damien George