aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.Damien 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
2018-05-10py/modbuiltins: Make built-in dir support the __dir__ special method.Damien George
If MICROPY_PY_ALL_SPECIAL_METHODS is enabled then dir() will now delegate to the special method __dir__ if the object it is listing has this method.
2018-05-10py/modbuiltins: In built-in dir make use of mp_load_method_protected.Damien George
This gives dir() better behaviour when listing the attributes of a user type that defines __getattr__: it will now not list those attributes for which __getattr__ raises AttributeError (meaning the attribute is not supported by the object).
2018-05-10py/repl: Use mp_load_method_protected to prevent leaking of exceptions.Damien George
This patch fixes the possibility of a crash of the REPL when tab-completing an object which raises an exception when its attributes are accessed. See issue #3729.
2018-05-10py/modbuiltins: Make built-in hasattr work properly for user types.Damien George
It now allows __getattr__ in a user type to raise AttributeError when the attribute does not exist.
2018-05-10py/runtime: Add mp_load_method_protected helper which catches exceptionsDamien George
This new helper function acts like mp_load_method_maybe but is wrapped in an NLR handler so it can catch exceptions. It prevents AttributeError from propagating out, and optionally all other exceptions. This helper can be used to fully implement hasattr (see follow-up commit), and also for cases where mp_load_method_maybe is used but it must now raise an exception.
2018-05-09py/{modbuiltins,repl}: Start qstr probing from after empty qstr.Damien George
The list of qstrs starts with MP_QSTR_NULL followed by MP_QSTR_, and these should never appear in dir() or REPL tab completion, so skip them.
2018-05-09stm32/usb: Use correct type for USB HID object.Damien George
2018-05-09stm32/usb: Fix broken pyb.have_cdc() so it works again.Damien George
2018-05-09stm32/i2c: Make sure stop condition is sent after receiving addr nack.Damien George
2018-05-08tests/cpydiff: Remove types_int_tobytesfloat now that it doesn't fail.Damien George
Commit e269cabe3ed8bed1b7181359febb686edbb748ae added a check that the first argument to the to_bytes() method is an integer, and now uPy follows CPython behaviour and raises a TypeError for this test. Note: CPython checks the argument types before checking the number of arguments, but uPy does it the other way around, so they give different exception messages for this test, but still the same type, a TypeError.
2018-05-04tests/cpydiff: Remove working cases from types_float_rounding.Damien George
2018-05-04tests/cpydiff: Remove types_str_decodeerror now that it succeeds.Damien George
Commit 68c28174d0e0ec3f6b1461aea3a0b6a1b84610bb implemented checking for valid utf-8 data.
2018-05-04tests/cpydiff: Remove core_function_unpacking now that it succeeds.Damien George
Commit 1e70fda69fcb4991eb60ed43e610f664ea1319e6 fixes this difference.
2018-05-04py/emitnx86: Fix 32-bit x86 native emitter build by including header.Damien George
2018-05-04stm32/Makefile: Use -O2 to optimise compilation of lib/libc/string0.c.Damien George
2018-05-04stm32: Don't use %lu or %lx for formatting, use just %u or %x.Damien George
On this 32-bit arch there's no need to use the long version of the format specifier. It's only there to appease the compiler which checks the type of the args passed to printf. Removing the "l" saves a bit of code space.
2018-05-04stm32/dma: Fix duplicate typedef of struct, it's typedef'd in dma.h.Damien George
2018-05-04extmod/modlwip: In ioctl handle case when socket is in an error state.Damien George
Using MP_STREAM_POLL_HUP for ERR_RST state follows how *nix handles this case.
2018-05-03esp32/modsocket: Check for pending events during blocking socket calls.Damien George
2018-05-02extmod/uzlib: Fix C-language sequencing error with uzlib_get_byte calls.Damien George
The order of function calls in an arithmetic expression is undefined and so they must be written out as sequential statements. Thanks to @dv-extrarius for reporting this issue, see issue #3690.
2018-05-02esp32: Use mp_rom_map_elem_t and MP_ROM_xxx macros for const dicts.Damien George
2018-05-02esp32/modsocket: Correctly handle reading from a peer-closed socket.Damien George
If a socket is cleanly shut down by the peer then reads on this socket should continue to return zero bytes. The lwIP socket API does not have this behaviour (it only returns zero once, then blocks on subsequent calls) so this patch adds explicit checks and logic for peer closed sockets.
2018-05-02esp32/README: Add --init to submodule update command.Torwag
Add --init to the submodule update example, thus, all submodules get initialised including the nested (--recursive) ones. Without it there might not be a submodule init.
2018-05-02tests/run-tests: Support esp32 as a target for running the test suite.Ayke van Laethem
2018-05-02extmod/vfs: Delegate import_stat to vfs.stat to allow generic FS import.Damien George
2018-05-02py/builtinhelp: Change occurrence of mp_uint_t to size_t.Damien George
2018-05-02esp8266: Disable DEBUG_PRINTERS for 512k build.Damien George
Disabling this saves around 6000 bytes of code space and gets the 512k build fitting in the available flash again (it increased lately due to an increase in the size of the ESP8266 SDK).
2018-05-02tests/pyb: Update tests to run correctly on PYBv1.0.Damien George
In adcall.py the pyb module may not be imported, so use ADCAll directly. In dac.py the DAC object now prints more info, so update .exp file. In spi.py the SPI should be deinitialised upon exit, so the test can run a second time correctly.
2018-05-02stm32/main: Clean up and optimise initial start-up code of the MCU.Damien George