summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-18py/compile: Change comment about ITER_BUF_NSLOTS to a static assertion.Damien George
2018-05-18py/misc.h: Add MP_STATIC_ASSERT macro to do static assertions.Damien George
2018-05-18stm32/boards: Add config files for new board, STM32L496GDISC.Tobias Badertscher
2018-05-18stm32/boards: Add board ld and af.csv files for STM32L496 MCU.Tobias Badertscher
2018-05-18stm32: Add support for STM32L496 MCU.Tobias Badertscher
2018-05-18py/repl: Fix handling of unmatched brackets and unfinished quotes.Li Weiwei
Before this patch: >>> print(') ... ') Traceback (most recent call last): File "<stdin>", line 1 SyntaxError: invalid syntax After this patch: >>> print(') Traceback (most recent call last): File "<stdin>", line 1 SyntaxError: invalid syntax This matches CPython and prevents getting stuck in REPL continuation when a 1-quote is unmatched.
2018-05-18py/vm: Improve performance of opcode dispatch when using switch stmt.Damien George
Before this patch, when using the switch statement for dispatch in the VM (not computed goto) a pending exception check was done after each opcode. This is not necessary and this patch makes the pending exception check only happen when explicitly requested by certain opcodes, like jump. This improves performance of the VM by about 2.5% when using the switch.
2018-05-18py/vm: Use enum names instead of magic numbers in multi-opcode dispatch.Damien George
2018-05-17esp8266/modmachine: Allow I2C and SPI to be configured out of the build.Damien George
I2C costs about 3000 bytes of code, and SPI costs about 4400 bytes.
2018-05-17extmod/modlwip: Set POLLHUP flag for sockets that are new.Damien George
This matches CPython behaviour on Linux: a socket that is new and not listening or connected is considered "hung up". Thanks to @rkojedzinszky for the initial patch, PR #3457.
2018-05-17esp8266/modnetwork: Raise ValueError when getting invalid WLAN id.Damien George
Instead of crashing due to out-of-bounds array access. Fixes #3348.
2018-05-17esp8266/modnetwork: Return empty str for hostname if STA is inactive.Damien George
Instead of crashing due to NULL pointer dereference. Fixes issue #3341.
2018-05-17esp8266/mpconfigport.h: Add some weak links to common Python modules.Damien George
To make it easier/simpler to write code that can run under both CPython and on an ESP8266 board.
2018-05-17lib/lwip: Update lwIP to v2.0.3, tag STABLE-2_0_3_RELEASE.Damien George
2018-05-17extmod/modlwip: Update to work with lwIP v2.0.Damien George
lwIP v2.0.3 has been tested with this lwip module and it works very well.
2018-05-17py/objfun: Fix variable name in DECODE_CODESTATE_SIZE() macro.Tom Collins
This patch fixes the macro so you can pass any name in, and the macro will make more sense if you're reading it on its own. It worked previously because n_state is always passed in as n_state_out_var.
2018-05-16py/vm: Adjust #if logic for gil_divisor so braces are balanced.Damien George
Having balanced braces { and } makes it easier to navigate the function.
2018-05-16stm32: Enable UART7/8 on F4 series that have these peripherals.Ryan Shaw
2018-05-15esp32/modnetwork: Fix STA/AP activate/deactivate for new IDF API.Damien George
WIFI_MODE_NULL is no longer supported by the ESP IDF, instead one must use esp_wifi_start/esp_wifi_stop.
2018-05-15py/nlrx86: Use naked attribute on nlr_push for gcc 8.0 and higher.Damien George
gcc 8.0 supports the naked attribute for x86 systems so it can now be used here. And in fact it is necessary to use this for nlr_push because gcc 8.0 no longer generates a prelude for this function (even without the naked attribute).
2018-05-15stm32/usb: Initialise cdc variable to prevent compiler warnings.Damien George
Some compilers cannot deduce that cdc will always be written before being used.
2018-05-14stm32/usb: Add ability to have 2x VCP interfaces on the one USB device.Damien George
This patch adds the configuration MICROPY_HW_USB_ENABLE_CDC2 which enables a new USB device configuration at runtime: VCP+VCP+MSC. It will give two independent VCP interfaces available via pyb.USB_VCP(0) and pyb.USB_VCP(1). The first one is the usual one and has the REPL on it. The second one is available for general use. This configuration is disabled by default because if the mode is not used then it takes up about 2200 bytes of RAM. Also, F4 MCUs can't support this mode on their USB FS peripheral (eg PYBv1.x) because they don't have enough endpoints. The USB HS peripheral of an F4 supports it, as well as both the USB FS and USB HS peripherals of F7 MCUs.
2018-05-14stm32/usb: Change HID report funcs to take HID state, not usbdev state.Damien George
2018-05-14stm32/usb: Change CDC tx/rx funcs to take CDC state, not usbdev state.Damien George
2018-05-14stm32/usb: Make CDC endpoint definitions private to core usbdev driver.Damien George
2018-05-14stm32/usb: Combine HID lower-layer and interface state into one struct.Damien George
2018-05-14stm32/usb: Combine CDC lower-layer and interface state into one struct.Damien George
2018-05-14stm32/usb: Use usbd_cdc_itf_t pointer directly in USB_VCP class.Damien George
2018-05-14stm32/modpyb: Remove unused includes and clean up comments.Damien George
The documentation (including the examples) for elapsed_millis and elapsed_micros can be found in docs/library/pyb.rst so doesn't need to be written in full in the source code.
2018-05-14stm32/pyb_i2c: Put pyb.I2C under MICROPY_PY_PYB_LEGACY setting.Damien George
When disabled, the pyb.I2C class saves around 8k of code space and 172 bytes of RAM. The same functionality is now available in machine.I2C (for F4 and F7 MCUs). It is still enabled by default.
2018-05-14stm32/modpyb: Introduce MICROPY_PY_PYB_LEGACY config option for pyb mod.Damien George
This is enabled by default. When it is disabled all legacy functions and classes in the pyb module are excluded from the build.
2018-05-14stm32/accel: Switch pyb.Accel to use new C-level I2C API.Damien George
2018-05-14stm32/machine_i2c: Use new F4 hardware I2C driver for machine.I2C class.Damien George
And remove the old one based on ST code.
2018-05-14stm32/i2c: Add new hardware I2C driver for F4 MCUs.Damien George
This driver uses low-level register access to control the I2C peripheral (ie it doesn't rely on the ST HAL) and provides the same C-level API as the existing F7 hardware driver.
2018-05-14stm32/usbd_hid_interface: Address possible race condition vs. interrupt.Peter D. Gray
The USB IRQ may fire once USBD_HID_ClearNAK() is called and then change the last_read_len value.
2018-05-14stm32/usbdev: Be honest about data not being written to HID endpoint.Peter D. Gray
USB_HID.send() should now return 0 if it could not send the report to the host.
2018-05-14esp32: Update to latest ESP IDF version.Bas Wijnen
- Updated supported git hash to current IDF version. - Added missing targets and includes to Makefile. - Updated error codes for networking module. - Added required constant to sdkconfig configuration.
2018-05-13py/mpstate.h: Adjust start of root pointer section to exclude non-ptrs.Damien George
This patch moves the start of the root pointer section in mp_state_ctx_t so that it skips entries that are not pointers and don't need scanning. Previously, the start of the root pointer section was at the very beginning of the mp_state_ctx_t struct (which is the beginning of mp_state_thread_t). This was the original assembler version of the NLR code was hard-coded to have the nlr_top pointer at the start of this state structure. But now that the NLR code is partially written in C there is no longer this restriction on the location of nlr_top (and a comment to this effect has been removed in this patch). So now the root pointer section starts part way through the mp_state_thread_t structure, after the entries which are not root pointers. This patch also moves the non-pointer entries for MICROPY_ENABLE_SCHEDULER outside the root pointer section. Moving non-pointer entries out of the root pointer section helps to make the GC more precise and should help to prevent some cases of collectable garbage being kept. This patch also has a measurable improvement in performance of the pystone.py benchmark: on unix x86-64 and stm32 there was an improvement of roughly 0.6% (tested with both gcc 7.3 and gcc 8.1).
2018-05-11stm32/usbdev: Remove unused RxState variable, and unused struct.Damien George
2018-05-11.gitattributes: Remove special text handling of stm32 usbdev files.Damien George
2018-05-11stm32/usbdev: Convert files to unix line endings.Damien George
Also remove trailing whitespace and convert tabs to spaces.
2018-05-11stm32/usbd_conf: Changes files to unix line endings and apply styling.Damien George
This patch is only cosmetic and has no functional change.
2018-05-11stm32/usbd_conf.h: Remove unused macros and clean up header file.Damien George
2018-05-11py/mpconfig.h: Be stricter when autodetecting machine endianness.Damien George
This patch changes 2 things in the endianness detection: 1. Don't assume that __BYTE_ORDER__ not being __ORDER_LITTLE_ENDIAN__ means that the machine is big endian, so add an explicit check that this macro is indeed __ORDER_BIG_ENDIAN__ (same with __BYTE_ORDER, __LITTLE_ENDIAN and __BIG_ENDIAN). A machine could have PDP endianness. 2. Remove the checks which base their autodetection decision on whether any little or big endian macros are defined (eg __LITTLE_ENDIAN__ or __BIG_ENDIAN__). Just because a system defines these does not mean it has that endianness. See issue #3760.
2018-05-11tests/basics/special_methods2: Enable some additional tests that work.Damien George
These special methods are all available if MICROPY_PY_ALL_SPECIAL_METHODS is enabled.
2018-05-11docs: Bump version to 1.9.4.v1.9.4Damien George
2018-05-11tests/float/float_parse: Allow test to run on 32-bit archs.Damien George
Printing of uPy floats can differ by the floating-point precision on different architectures (eg 64-bit vs 32-bit x86), so it's not possible to using printing of floats in some parts of this test. Instead we can just check for equivalence with what is known to be the correct answer.
2018-05-11py/repl: Initialise q_last variable to prevent compiler warnings.Damien George
Some older compilers cannot deduce that q_last is always written to before being read.
2018-05-11py/objdeque: Fix sign extension bug when computing len of deque object.Damien George
For cases where size_t is smaller than mp_int_t (eg nan-boxing builds) the difference between two size_t's is not sign extended into mp_int_t and so the result is never negative. This patch fixes this bug by using ssize_t for the type of the result.
2018-05-11stm32/README: Update to reflect current MCU support.Damien George