summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-10travis: Use --upgrade when pip is installing cpp-coveralls.Damien George
So that the latest urllib3 is retrieved, which has improved SSL security. This fixes the temporary path from f578947ae3fee5610c5bc1123baf878b92eaa248
2017-09-10esp8266: Set DEFPSIZE=1024, MINCACHE=3 for "btree" module.Paul Sokolovsky
Defaults of 4096 and 5 respectively are too high to esp8266, causing out of memory with a database beyond couple of pages.
2017-09-10berkeley-db-1.xx: Update, allow to override MINCACHE, DEFPSIZE.Paul Sokolovsky
2017-09-10esp8266/posix_helpers: Set ENOMEM on memory alloc failure.Paul Sokolovsky
POSIX requires malloc(), etc. to set ENOMEM on the failure, and e.g. BerkeleyDB relies on this: http://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html This should fix confusing OSError exceptions with 0 error code when working with btree module.
2017-09-10esp8266: Rename axtls_helpers.c to posix_helpers.c.Paul Sokolovsky
As it's used by BerkeleyDB, etc.
2017-09-10stm32/boards: Add new board B_L475E_IOT01A based on STM32L475.Tobias Badertscher
2017-09-10py/builtinhelp: Simplify code slightly by extracting object type.Damien George
Reduces code size by about 10 bytes.
2017-09-09docs/reference/isr_rules.rst Add tutorial on use of micropython.schedule().Peter Hinch
2017-09-08stm32/modnwwiznet5k: Release the GIL on blocking network operations.Damien George
connect, send, recv, sendto and recvfrom now release the GIL. accept already releases the GIL because it calls mp_hal_delay_ms() within its busy-wait loop.
2017-09-08tests/run-bench-tests: Update locations of executables, now in ports/.Damien George
2017-09-08stm32/i2c: When scanning for I2C devices only do 1 probe per address.Damien George
Previous to this patch the i2c.scan() method would do up to 100 probes per I2C address, to detect the devices on the bus. This repeated probing was a relic from when the code was copied from the accelerometer initialisation, which requires to do repeated probes while waiting for the accelerometer chip to turn on. But I2C devices shouldn't need more than 1 probe to detect their presence, and the generic software I2C implementation uses 1 probe successfully. So this patch changes the implementation to use 1 probe per address, which significantly speeds up the scan operation.
2017-09-08py/runtime0.h: Put inplace arith ops in front of normal operations.Paul Sokolovsky
This is to allow to place reverse ops immediately after normal ops, so they can be tested as one range (which is optimization for reverse ops introduction in the next patch).
2017-09-07py/runtime0.h: Regroup operations a bit.Paul Sokolovsky
Originally, there were grouped in blocks of 5, to make it easier e.g. to assess and numeric code of each. But now it makes more sense to group it by semantics/properties, and then split in chunks still, which usually leads to chunks of ~6 ops.
2017-09-07py/objtype: Make sure mp_binary_op_method_name has full size again.Paul Sokolovsky
After recent refactorings to mp_binary_op_t, and make it future refactoring proof for now, at the cost of extra element in the array.
2017-09-07py/runtime0.h: Move MP_BINARY_OP_DIVMOD to the end of mp_binary_op_t.Paul Sokolovsky
It starts a dichotomy of mp_binary_op_t values which can't appear in the bytecode. Another reason to move it is to VALUES of OP_* and OP_INPLACE_* nicely adjacent. This also will be needed for OP_REVERSE_*, to be soon introduced.
2017-09-07py/runtime0.h: Move relational ops to the beginning of mp_binary_op_t.Paul Sokolovsky
This is to allow to encode arithmetic operations more efficiently, in preparation to introduction of __rOP__ method support.
2017-09-07py/objlist: Properly implement comparison with incompatible types.Paul Sokolovsky
Should raise TypeError, unless it's (in)equality comparison.
2017-09-06extmod/modussl_mbedtls: Allow to compile with MBEDTLS_DEBUG_C disabled.Damien George
With MBEDTLS_DEBUG_C disabled the function mbedtls_debug_set_threshold() doesn't exist. There's also no need to call mbedtls_ssl_conf_dbg() so a few bytes can be saved on disabling that and not needing the mbedtls_debug callback.
2017-09-06py/objstr: Add check for valid UTF-8 when making a str from bytes.tll
This patch adds a function utf8_check() to check for a valid UTF-8 encoded string, and calls it when constructing a str from raw bytes. The feature is selectable at compile time via MICROPY_PY_BUILTINS_STR_UNICODE_CHECK and is enabled if unicode is enabled. It costs about 110 bytes on Thumb-2, 150 bytes on Xtensa and 170 bytes on x86-64.
2017-09-06stm32/boards: Fix I2C1 pin mapping on NUCLEO_F401RE/F411RE boards.Damien George
This patch makes it consistent with the STM document describing the Arduino layout. Thanks to @shaoziyang for the original patch.
2017-09-06stm32/boards: Change linker scripts to use "K" instead of hex byte size.Damien George
2017-09-06stm32/boards: Change remaining stm32f4xx_hal_conf.h to unix line ending.Damien George
2017-09-06stm32: Replace stray tabs with spaces.Damien George
2017-09-06stm32: Remove unused usbd_msc.c file.Damien George
2017-09-06all: Update Makefiles and others to build with new ports/ dir layout.Damien George
Also renames "stmhal" to "stm32" in documentation and everywhere else.
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.
2017-09-06.gitattributes: Add entries for files that will move to ports/ dir.Damien George
2017-09-06py/objtuple: Properly implement comparison with incompatible types.Paul Sokolovsky
Should raise TypeError, unless it's (in)equality comparison.
2017-09-05stmhal/timer: Remove unnecessary include of USB header files.Damien George
2017-09-04tests/class_inplace_op: Test for inplace op fallback to normal one.Paul Sokolovsky
2017-09-04py/objtype: Implement fallback for instance inplace special methods.Paul Sokolovsky
If __iop__ is not defined, call __op__ instead. This is desired behavior for immutable types, __iop__ needs to be defined only for mutable types.
2017-09-04py/obj: Remove declaration for mp_obj_new_none(), it's never defined.Damien George
2017-09-04stmhal: Fix clock initialisation of L4 MCUs.Tobias Badertscher
There are 2 changes: - remove early initialisation of LSE and replaced it by LSEDRIVE config (there is no reason to call HAL_RCC_OscConfig twice). - add initialisation of the variables PLLSAI1Source and PLLSAI1M as they are needed in Cube HAL 1.8.1.
2017-09-04cc3200: Use standard implementation of keyboard interrupt.Damien George
2017-09-04cc3200: Enable micropython.kbd_intr() methodRobert HH
2017-09-04py/obj: Fix comparison of float/complex NaN with itself.Damien George
IEEE floating point is specified such that a comparison of NaN with itself returns false, and Python respects these semantics. This patch makes uPy also have these semantics. The fix has a minor impact on the speed of the object-equality fast-path, but that seems to be unavoidable and it's much more important to have correct behaviour (especially in this case where the wrong answer for nan==nan is silently returned).
2017-09-02py/objfloat: Fix binary ops with incompatible objects.Paul Sokolovsky
These are now returned as "operation not supported" instead of raising TypeError. In particular, this fixes equality for float vs incompatible types, which now properly results in False instead of exception. This also paves the road to support reverse operation (e.g. __radd__) with float objects. This is achieved by introducing mp_obj_get_float_maybe(), similar to existing mp_obj_get_int_maybe().
2017-09-01py/nlrthumb: Get working again on standard Thumb arch (ie not Thumb2).Damien George
"b" on Thumb might not be long enough for the jump to nlr_push_tail so it must be done indirectly.
2017-09-01py/qstrdefs: Remove unused qstrs.Damien George
They are not used by any component and take up valuable flash space.
2017-09-01.gitattributes: Remove obsolete entries for stmhal/hal, stmhal/cmsis.Damien George
2017-09-01pic16bit: Add definition of SEEK_SET to unistd.h.Damien George
2017-09-01py/modstruct: Check and prevent buffer-write overflow in struct packing.Damien George
Prior to this patch, the size of the buffer given to pack_into() was checked for being too small by using the count of the arguments, not their actual size. For example, a format spec of '4I' would only check that there was 4 bytes available, not 16; and 'I' would check for 1 byte, not 4. The pack() function is ok because its buffer is created to be exactly the correct size. The fix in this patch calculates the total size of the format spec at the start of pack_into() and verifies that the buffer is large enough. This adds some computational overhead, to iterate through the whole format spec. The alternative is to check during the packing, but that requires extra code to handle alignment, and the check is anyway not needed for pack(). So to maintain minimal code size the check is done using struct_calcsize.
2017-09-01py/modstruct: Check and prevent buffer-read overflow in struct unpackingDamien George
Prior to this patch, the size of the buffer given to unpack/unpack_from was checked for being too small by using the count of the arguments, not their actual size. For example, a format spec of '4I' would only check that there was 4 bytes available, not 16; and 'I' would check for 1 byte, not 4. This bug is fixed in this patch by calculating the total size of the format spec at the start of the unpacking function. This function anyway needs to calculate the number of items at the start, so calculating the total size can be done at the same time.
2017-09-01py/modstruct: In struct.pack, stop converting if there are no args left.Damien George
This patch makes a repeat counter behave the same as repeating the typecode, when there are not enough args. For example: struct.pack('2I', 1) now behave the same as struct.pack('II', 1).
2017-09-01tests/class_new: Add another testcase for __new__/__init__ interaction.Paul Sokolovsky
Similar to the existing testcase, but test that returning both value of native type and instance of another user class from __new__ lead to __init__ not being called, for better coverage.
2017-08-31py: Make m_malloc_fail() have void return type, since it doesn't return.Damien George
2017-08-31py/map: Remove unused new/free functions.Damien George
Maps are always allocated "statically" and (de)initialised via mp_map_init and mp_map_deinit.
2017-08-31py/map: Replace always-false condition with assertion.Damien George
2017-08-31extmod/modubinascii: Only include uzlib/tinf.h when it's really needed.Damien George
2017-08-31py/objtype: mp_obj_class_lookup: Improve debug logging.Paul Sokolovsky
Now traces more explicitly thru the lookup process.