aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-12-29py/objslice: Inline fetching of slice paramters in str_subscr().Nicko van Someren
To reduce code size.
2019-12-28py/objslice: Add support for indices() method on slice objects.Nicko van Someren
Instances of the slice class are passed to __getitem__() on objects when the user indexes them with a slice. In practice the majority of the time (other than passing it on untouched) is to work out what the slice means in the context of an array dimension of a particular length. Since Python 2.3 there has been a method on the slice class, indices(), that takes a dimension length and returns the real start, stop and step, accounting for missing or negative values in the slice spec. This commit implements such a indices() method on the slice class. It is configurable at compile-time via MICROPY_PY_BUILTINS_SLICE_INDICES, disabled by default, enabled on unix, stm32 and esp32 ports. This commit also adds new tests for slice indices and for slicing unicode strings.
2019-12-28nrf/examples: Fix typo in mountsd.py, wireing -> wiring.Tim Gates
2019-12-28unix/modos: Add uos.rename and uos.rmdir.Damien George
The existing uos.remove cannot be used to remove directories, instead uos.rmdir is needed. And also provide uos.rename to get a good set of filesystem functionality without requiring additional Python-level os functions (eg using ffi).
2019-12-28unix/modtime: Add utime.mktime function, to complement utime.localtime.Andrew Leech
This also adds it to the windows port.
2019-12-28py: Clean up commented-out code and comments about exception hierarchy.Damien George
In CPython, EnvironmentError and IOError are now aliases of OSError so no need to have them listed in the code. OverflowError inherits from ArithmeticError because it's intended to be raised "when the result of an arithmetic operation is too large to be represented" (per CPython docs), and MicroPython aims to match the CPython exception hierarchy.
2019-12-28nrf/main: Remove unnecessary repl_info(0) call.Yonatan Goldschmidt
It's statically initialized to 0.
2019-12-28lib/utils/pyexec: Introduce MICROPY_REPL_INFO, wrap debug prints in it.Yonatan Goldschmidt
For the 3 ports that already make use of this feature (stm32, nrf and teensy) this doesn't make any difference, it just allows to disable it from now on. For other ports that use pyexec, this decreases code size because the debug printing code is dead (it can't be enabled) but the compiler can't deduce that, so code is still emitted.
2019-12-27extmod/modbluetooth: Fix func prototype, empty args should be (void).Yonatan Goldschmidt
This fixes a -Wstrict-prototypes error.
2019-12-27ports: Allow overriding CROSS_COMPILE in a custom makefile.David Lechner
Many ports already allow overriding CROSS_COMPILE. This modifies the remaining ports to allow it as well.
2019-12-27py/obj.h: Use 32-bit shift in MP_OBJ_NEW_QSTR calc for obj-repr D.Damien George
The qst value is always small enough to fit in 31-bits (even less) and using a 32-bit shift rather than a 64-bit shift reduces code size by about 300 bytes.
2019-12-27py/objstr: Don't use inline GET_STR_DATA_LEN for object-repr D.Damien George
Changing to use the helper function mp_obj_str_get_data_no_check() reduces code size of nan-boxing builds by about 1000 bytes.
2019-12-27travis: Add stm32 build in nanbox mode.Damien George
2019-12-27stm32: Add configuration to build in nanbox mode.Damien George
Most stm32 boards can now be built in nan-boxing mode via: $ make NANBOX=1 Note that if float is enabled then it will be forced to double-precision. Also, native emitters will be disabled.
2019-12-27stm32: Fix to build in nanbox mode.Damien George
2019-12-27drivers/cyw43: Fix to build in nanbox mode.Damien George
2019-12-27extmod: Fix modbluetooth and modwebrepl to build in nanbox mode.Damien George
2019-12-27py/objobject: Fix __setattr__/__delattr__ to build in nanbox mode.Damien George
2019-12-27py: Introduce MP_ROM_FALSE/MP_ROM_TRUE for ROM to refer to bool objects.Damien George
This helps to prevent mistakes, and allows easily changing the ROM value of False/True if needed.
2019-12-27py: Introduce MP_ROM_NONE macro for ROM to refer to None object.Damien George
This helps to prevent mistakes, and allows easily changing the ROM value of None if needed.
2019-12-27py/objsingleton: Use mp_generic_unary_op for singleton objects.Damien George
So these types more closely match NoneType, eg they can be hashed, like in CPython.
2019-12-27tests/micropython: Add test for yield-from while heap is locked.Damien George
2019-12-27py/runtime: Don't allocate iter buf for user-defined types.Damien George
A user-defined type that defines __iter__ doesn't need any memory to be pre-allocated for its iterator (because it can't use such memory). So optimise for this case by not allocating the iter-buf.
2019-12-27travis: Add new job to build and test unix coverage in 32-bit mode.Damien George
2019-12-27tests/extmod: Split out VfsFat finaliser tests to separate test file.Damien George
It tests independent functionality and may need to be skipped for a given port.
2019-12-27tests/run-tests: Add "--mpy-cross-flags" arg to specify mpy-cross flags.Damien George
2019-12-27py/asmx86: Remove unused 5th argument facility.Damien George
In commit 71a3d6ec3bd02c5bd13334537e1bd146bb643bad mp_setup_code_state was changed from a 5-arg function to a 4-arg function, and at that point 5-arg calls in native code were no longer needed. See also commit 4f9842ad80c235188955fd83317f715033a596c0.
2019-12-27py/asmx86: Fix stack to be 16-byte aligned for entry and sub-call.Damien George
2019-12-23extmod/uzlib: Explicitly cast ptr-diff-expr to unsigned.Damien George
The struct member "dest" should never be less than "destStart", so their difference is never negative. Cast as such to make the comparison explicitly unsigned, ensuring the compiler produces the correct comparison instruction, and avoiding any compiler warnings.
2019-12-23py/nlrx86: Silence possible warnings about unused nlr argument.Damien George
2019-12-21py/objobject: Add object.__delattr__ function.Yonatan Goldschmidt
Similar to object.__setattr__.
2019-12-21py/objobject: Add object.__setattr__ function.Yonatan Goldschmidt
Allows assigning attributes on class instances that implement their own __setattr__. Both object.__setattr__ and super(A, b).__setattr__ will work with this commit.
2019-12-21stm32/mbedtls: Resize mbedtls output buffer from 16 down to 4 kiB.Jim Mussared
To reduce the size of the SSL context on the heap. See issue #5303.
2019-12-20py/obj.h: Remove comments about additional mp_buffer_info_t entries.Damien George
These entries are unlikely to be needed, so remove them to clean up the struct definition.
2019-12-20py: Remove commented-out debug printf's from emitbc and objlist.Damien George
Any debugging prints should use a macro like DEBUG_printf.
2019-12-20all: Bump version to 1.12.Damien George
2019-12-20tests/pyb: Adjust UART and Timer tests to work on PYBD_SF6.Damien George
2019-12-20py/profile: Fix debug opcode decoding of MP_BC_RAISE_xxx opcodes.Damien George
2019-12-20py/vm: Fix comment to refer to MP_BC_RAISE_OBJ instead of RAISE_VARARGS.Damien George
2019-12-20stm32/boards/PYBD: Include webrepl helper scripts in frozen manifest.Damien George
2019-12-20extmod/webrepl: Move webrepl scripts to common place and use manifest.Jim Mussared
Move webrepl support code from ports/esp8266/modules into extmod/webrepl (to be alongside extmod/modwebrepl.c), and use frozen manifests to include it in the build on esp8266 and esp32. A small modification is made to webrepl.py to make it work on non-ESP ports, i.e. don't call dupterm_notify if not available.
2019-12-20docs/esp32: Add quickref and full docs for esp32.RMT class.Matt Trentini
2019-12-20esp32/esp32_rmt: Add initial support for RMT peripheral.Matt Trentini
This is an ESP32-specific peripheral so lives in the esp32 module.
2019-12-19qemu-arm/Makefile: Allow overriding CROSS_COMPILE from another makefile.David Lechner
2019-12-19tools/tinytest-codegen.py: Add extra newline and result message.David Lechner
This is an alternative to f4ed2df that adds a newline so that the output of the test starts on a new line and the result of the test is prefixed with "result: " to distinguish it from the test output. Suggested-by: @dpgeorge
2019-12-19Revert "lib/tinytest: Clean up test reporting in the presence of std..."David Lechner
This reverts commit f4ed2dfa942339dc1f174e8a83ff0d41073f1972. This lets tinytest work as it was originally designed. An alternate solution for the reverted commit will be implemented in a future commit.
2019-12-19stm32/timer: Add missing TIM 1/15/16/17 IRQ handlers for H7 MCUs.iabdalkader
2019-12-19docs/develop: Add documentation on how to build native .mpy modules.Damien George
2019-12-19docs/reference: Add documentation describing use of .mpy files.Damien George
Including information about .mpy versioning and how to debug failed imports of .mpy files.
2019-12-19examples/natmod: Add very simple features0 example to compute factorial.Damien George