summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-04docs/develop/qstr.rst: Add documentation for string interning.Jim Mussared
2019-10-04py/compile: Disallow 'import *' outside module level.Petr Viktorin
This check follows CPython's behaviour, because 'import *' always populates the globals with the imported names, not locals. Since it's safe to do this (doesn't lead to a crash or undefined behaviour) the check is only enabled for MICROPY_CPYTHON_COMPAT. Fixes issue #5121.
2019-10-04stm32/boards: Enable MICROPY_HW_RTC_USE_LSE on L4 boards.Damien George
The previous commit changed the default configuration on L4 MCUs to use LSI, so configure these boards to use LSE again.
2019-10-04stm32/system_stm32: Support selection of HSE and LSI on L4 MCUs.hahmadi
This commit adds the option to use HSE or MSI system clock, and LSE or LSI RTC clock, on L4 MCUs. Note that prior to this commit the default clocks on an L4 part were MSI and LSE. The defaults are now MSI and LSI. In mpconfigboard.h select the clock source via: #define MICROPY_HW_RTC_USE_LSE (0) or (1) #define MICROPY_HW_CLK_USE_HSE (0) or (1) and the PLLSAI1 N,P,Q,R settings: #define MICROPY_HW_CLK_PLLSAIN (12) #define MICROPY_HW_CLK_PLLSAIP (RCC_PLLP_DIV7) #define MICROPY_HW_CLK_PLLSAIQ (RCC_PLLQ_DIV2) #define MICROPY_HW_CLK_PLLSAIR (RCC_PLLR_DIV2)
2019-10-02nrf/main: Update the way the LED is used on startup.roland van straten
In case of LED1 being present, do a short blink during startup instead of turning it on and leave it on.
2019-10-02nrf/led: Expose public API for LED manipulation.roland van straten
Aligned implementation with the STM32 port. Added empty functions to be used when no LED is available.
2019-10-02nrf/flash: Update flash driver to use nrfx_nvmc driver.Glenn Ruben Bakke
The the nrfx driver is aware of chip specific registers, while the raw HAL abstraction is not. This driver enables use of NVMC in non-secure domain for nrf9160.
2019-10-02nrf/uart: Add support for UARTE (EasyDMA).Glenn Ruben Bakke
2019-10-02nrf/temp: Move module configuration guard.Glenn Ruben Bakke
This patch moves the check for MICROPY_PY_MACHINE_TEMP to come before the inclusion of nrf_temp.h. The nrf_temp.h depends on the NRF_TEMP_Type which might not be defined for all nRF devices.
2019-10-02nrf/i2c: Add support for TWIM (EasyDMA).Glenn Ruben Bakke
2019-10-01tests/basics: Add test for getting name of func with closed over locals.Damien George
Tests correct decoding of the prelude to get the function name.
2019-10-01py/bc: Don't include mp_decode_uint funcs when not needed.Damien George
These are now only needed when persistent code is disabled.
2019-10-01minimal/frozentest.mpy: Update due to change in bytecode.Damien George
2019-10-01py: Rework and compress second part of bytecode prelude.Damien George
This patch compresses the second part of the bytecode prelude which contains the source file name, function name, source-line-number mapping and cell closure information. This part of the prelude now begins with a single varible length unsigned integer which encodes 2 numbers, being the byte-size of the following 2 sections in the header: the "source info section" and the "closure section". After decoding this variable unsigned integer it's possible to skip over one or both of these sections very easily. This scheme saves about 2 bytes for most functions compared to the original format: one in the case that there are no closure cells, and one because padding was eliminated.
2019-10-01py: Compress first part of bytecode prelude.Damien George
The start of the bytecode prelude contains 6 numbers telling the amount of stack needed for the Python values and exceptions, and the signature of the function. Prior to this patch these numbers were all encoded one after the other (2x variable unsigned integers, then 4x bytes), but using so many bytes is unnecessary. An entropy analysis of around 150,000 bytecode functions from the CPython standard library showed that the optimal Shannon coding would need about 7.1 bits on average to encode these 6 numbers, compared to the existing 48 bits. This patch attempts to get close to this optimal value by packing the 6 numbers into a single, varible-length unsigned integer via bit-wise interleaving. The interleaving scheme is chosen to minimise the average number of bytes needed, and at the same time keep the scheme simple enough so it can be implemented without too much overhead in code size or speed. The scheme requires about 10.5 bits on average to store the 6 numbers. As a result most functions which originally took 6 bytes to encode these 6 numbers now need only 1 byte (in 80% of cases).
2019-10-01py: Add n_state to mp_code_state_t struct.Damien George
This value is used often enough that it is better to cache it instead of decode it each time.
2019-10-01py/bc: Change mp_code_state_t.exc_sp to exc_sp_idx.Damien George
Change from a pointer to an index, to make space in mp_code_state_t.
2019-10-01py/bc: Remove comments referring to obsolete currently_in_except_block.Damien George
It was made obsolete in 6f9e3ff719917616f163d3d671d6abe9472ba6ff
2019-10-01stm32/boards/PYBD: Enable BLE for Pyboard D.Jim Mussared
2019-10-01stm32/mpconfigport.h: Add modbluetooth module to stm32.Jim Mussared
2019-10-01extmod/modbluetooth: Allow MP_BLUETOOTH_MAX_ATTR_SIZE in board config.Andrew Leech
2019-10-01extmod/modbluetooth_nimble: Use random addr if public isn't available.Andrew Leech
2019-10-01extmod/modbluetooth_nimble: Implement modbluetooth API with Nimble.Jim Mussared
2019-10-01extmod/modbluetooth: Add low-level Python BLE API.Jim Mussared
2019-10-01unix/coverage: Add coverage tests for ringbuf.Jim Mussared
2019-10-01py/ringbuf: Add helpers for put16/get16.Jim Mussared
2019-10-01stm32: Provide port-specific implementation for Nimble on STM32.Jim Mussared
2019-10-01extmod/nimble: Add nimble bindings.Damien George
2019-10-01lib/mynewt-nimble: Add Apache mynewt nimble as a submodule.Damien George
Tag nimble_1_1_0_tag.
2019-10-01drivers/cyw43: Add low-level CYW43xx Bluetooth HCI UART driver.Damien George
2019-09-27stm32/uart: Add RTS/CTS pin configuration support to UART4.Andrew Leech
2019-09-26stm32/powerctrlboot: Add support for HSI at 8MHz on F0 MCUs.Chris Mason
For use with F0 MCUs that don't have HSI48. Select the clock source explicitly in mpconfigboard.h. On the NUCLEO_F091RC board use HSE bypass when HSE is chosen because the NUCLEO clock source is STLINK not a crystal.
2019-09-26stm32/powerctrlboot: Fix clock and PLL selection for HSI48 on F0 MCUs.Chris Mason
Before this patch the UART baudrate on F0 MCUs was wrong because the stm32lib SystemCoreClockUpdate sets SystemCoreClock to 8MHz instead of 48MHz if HSI48 is routed directly to SYSCLK. The workaround is to use HSI48 -> PREDIV (/2) -> PLL (*2) -> SYSCLK. Fixes issue #5049.
2019-09-26stm32: Support disabling the compiler.Damien George
Disable via "#define MICROPY_ENABLE_COMPILER (0)" in the board's mpconfigboard.h file.
2019-09-26tests/micropython: Add test for native generators.Damien George
2019-09-26travis: Build more stm32 boards to cover all supported MCUs.Damien George
2019-09-26minimal/frozentest: Recompile now that mpy version has changed.Damien George
2019-09-26py/persistentcode: Bump .mpy version to 5.Damien George
The bytecode opcodes have changed (there are more, and they have been reordered).
2019-09-26py/nativeglue: Make mp_fun_table fixed size regardless of config.Damien George
So that mpy files with native code will always work correctly, and raise an exception if a feature is used that is not supported by the runtime.
2019-09-26py: Rename MP_QSTR_NULL to MP_QSTRnull to avoid intern collisions.Josh Lloyd
Fixes #5140.
2019-09-26mpy-cross: Set number of registers in nlr_buf_t based on native arch.Damien George
Fixes #5059. Done in collaboration with Jim Mussared.
2019-09-26py/emitnative: Factor sizeof/offsetof calculations to macros.Damien George
2019-09-26py/nlr.h: Factor out constants to specific macros.Damien George
2019-09-26py: Split RAISE_VARARGS opcode into 3 separate ones.Damien George
From the beginning of this project the RAISE_VARARGS opcode was named and implemented following CPython, where it has an argument (to the opcode) counting how many args the raise takes: raise # 0 args (re-raise previous exception) raise exc # 1 arg raise exc from exc2 # 2 args (chained raise) In the bytecode this operation therefore takes 2 bytes, one for RAISE_VARARGS and one for the number of args. This patch splits this opcode into 3, where each is now a single byte. This reduces bytecode size by 1 byte for each use of raise. Every byte counts! It also has the benefit of reducing code size (on all ports except nanbox).
2019-09-26py: Introduce and use constants for multi-opcode sizes.Damien George
2019-09-26py/bc: Replace big opcode format table with simple macro.Damien George
2019-09-26tests: Update tests for changes to opcode ordering.Damien George
2019-09-26py/bc0: Order opcodes into groups based on their size and format.Damien George
2019-09-26tests/basics: Add test for matmul operator.Damien George
This is a Python 3.5 feature so the .exp file is needed.
2019-09-26py: Add support for matmul operator @ as per PEP 465.Damien George
To make progress towards MicroPython supporting Python 3.5, adding the matmul operator is important because it's a really "low level" part of the language, being a new token and modifications to the grammar. It doesn't make sense to make it configurable because 1) it would make the grammar and lexer complicated/messy; 2) no other operators are configurable; 3) it's not a feature that can be "dynamically plugged in" via an import. And matmul can be useful as a general purpose user-defined operator, it doesn't have to be just for numpy use. Based on work done by Jim Mussared.