aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-02-09examples/hwapi: Be sure to import Signal when it's used.Damien George
2017-02-09examples/hwapi: Add hwconfig_pyboard.py for pyboard.Kai Fricke
2017-02-09py/objtype: Implement __delattr__ and __setattr__.dmazzella
This patch implements support for class methods __delattr__ and __setattr__ for customising attribute access. It is controlled by the config option MICROPY_PY_DELATTR_SETATTR and is disabled by default.
2017-02-09extmod/vfs: Allow to mount a block device, not just a VFS object.Damien George
If the mounted object doesn't have a "mount" method then assume it's a block device and try to detect the filesystem. Since we currently only support FAT filesystems, the behaviour is to just try and create a VfsFat object automatically, using the given block device.
2017-02-08extmod/machine_signal: Implement Signal .on() and .off() methods.Paul Sokolovsky
Each method asserts and deasserts signal respectively. They are equivalent to .value(1) and .value(0) but conceptually simpler (and may help to avoid confusion with inverted signals, where "asserted" state means logical 0 output).
2017-02-08stmhal/Makefile: Drop use of -mabi=aapcs-linux; link libgcc by default.Damien George
The aapcs-linux ABI is not required, instead the default aapcs ABI is enough. And using the default ABI means that the provided libgcc will now link with the firmware without warnings about variable vs fixed enums. Although the binary size increases by about 1k, RAM usage is slightly decreased. And libgcc may prove useful in the future for things like long-long division.
2017-02-08py/nlr: Fix execstack builds for ARM.Dave Hylands
It seems that the gcc toolchain on the RaspberryPi likes %progbits instead of @progbits. I verified that %progbits also works under x86, so this should fix #2848 and fix #2842 I verified that unix and mpy-cross both compile on my RaspberryPi and on my x64 machine.
2017-02-08py/map: Change mp_uint_t to size_t where appropriate.Damien George
The internal map/set functions now use size_t exclusively for computing addresses. size_t is enough to reach all of available memory when computing addresses so is the right type to use. In particular, for nanbox builds it saves quite a bit of code size and RAM compared to the original use of mp_uint_t (which is 64-bits on nanbox builds).
2017-02-08py/asmxtensa.h: Explicitly cast args to 32-bits so left-shift is legal.Damien George
For archs that have 16-bit pointers, the asmxtensa.h file can give compiler warnings about left-shift being greater than the width of the type (due to the inline functions in this header file). Explicitly casting the constants to uint32_t stops these warnings.
2017-02-07docs: Add M-logo as favicon.Damien George
2017-02-07docs/esp8266/tutorial: Specify the baudrate in picocom example command.Damien George
2017-02-07stmhal: Add ability to skip booting from SD card via /flash/SKIPSD file.Damien George
2017-02-07unix/main: Properly handle MICROPYPATH starting with ':'.Paul Sokolovsky
In other words, where first path component is an empty string.
2017-02-06unix: Fix freedos port build problems.Nikita Melentev
2017-02-06stmhal: Use MICROPY_EVENT_POLL_HOOK instead of __WFI where appropriate.Damien George
2017-02-06extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func.Damien George
SPI needs to be fast, and calling the EVENT_POLL_HOOK every byte makes it unusable for ports that need to do non-trivial work in the EVENT_POLL_HOOK call. And individual SPI transfers should be short enough in time that EVENT_POLL_HOOK doesn't need to be called. If something like this proves to be needed in practice then we will need to introduce separate event hook macros, one for "slow" loops (eg select/poll) and one for "fast" loops (eg software I2C, SPI).
2017-02-06tests/pyb: Adjust tests so they can run on PYB and PYBLITE.Damien George
A few tests still fail on PYBLITE, and that's due to differences in the available peripheral block numbers on the different MCUs (eg I2C(2) exists on one, but it's I2C(3) on the other).
2017-02-06stmhal: Add pyb.fault_debug() function, to control hard-fault behaviour.Damien George
This new function controls what happens on a hard-fault: - debugging disabled: board will do a reset - debugging enabled: board will print registers and stack and flash LEDs The default is disabled, ie to do a reset. This is different to previous behaviour which flashed the LEDs and waited indefinitely.
2017-02-06stmhal: On HardFault, print stack pointer and do a stack dump.Damien George
2017-02-06cc3200: Refactor "ticks" functions to use common extmod implementation.Damien George
The port now uses the common mp_utime_ticks_{ms,us,cpu,add,diff} functions from extmod/utime_mphal.c. The mp_utime_sleep_XXX functions are still cc3200-specific because they handle the GIL differently to the ones in extmod. The files misc/mpsystick.[ch] have been removed because they contain 2 unused functions, and the other remaining function is renamed to mp_hal_ticks_us and moved to hal/cc3200_hal.c.
2017-02-05examples/button_reaction: Update for time_pulse_us() no longer raising exc.Paul Sokolovsky
2017-02-05extmod/machine_pulse: Make time_pulse_us() not throw exceptions.Paul Sokolovsky
machine.time_pulse_us() is intended to provide very fine timing, including while working with signal bursts, where each transition is tracked in row. Throwing and handling an exception may take too much time and "signal loss". So instead, in case of a timeout, just return negative value. Cases of timeout while waiting for initial signal stabilization, and during actual timing, are recognized. The documentation is updated accordingly, and rewritten somewhat to clarify the function behavior.
2017-02-04py/objcomplex: Fix typo in ternary expression.Damien George
This typo actually did the correct thing, but it was very obscure (came about from think in terms of Python's "x if cond else y" expression).
2017-02-03esp8266/uart: Add support for polling uart device.marc hoffman
2017-02-03py/objstr: Convert some instances of mp_uint_t to size_t.Damien George
2017-02-03docs: For LCD160CR driver and tutorial, add link to positioning image.Damien George
2017-02-03stmhal/mpconfigport.h: Enable MICROPY_PY_BUILTINS_POW3 option.Damien George
2017-02-03qemu-arm/mpconfigport.h: Enable MICROPY_PY_BUILTINS_POW3 option.Damien George
2017-02-03py/mpconfig.h: Move PY_BUILTINS_POW3 config option to diff part of file.Damien George
With so many config options it's good to (at least try to) keep them grouped into logical sections.
2017-02-03tests/basics/string_format_modulo: Add more tests for dict formatting.Damien George
2017-02-03py/objstr: Give correct behaviour when passing a dict to %-formatting.Damien George
This patch fixes two main things: - dicts can be printed directly using '%s' % dict - %-formatting should not crash when passed a non-dict to, eg, '%(foo)s'
2017-02-02tests: Split tests for 2- and 3-arg pow().Paul Sokolovsky
2017-02-02py: Added optimised support for 3-argument calls to builtin.pow()Nicko van Someren
Updated modbuiltin.c to add conditional support for 3-arg calls to pow() using MICROPY_PY_BUILTINS_POW3 config parameter. Added support in objint_mpz.c for for optimised implementation.
2017-02-03py/objset: Fix inplace binary ops so frozensets are not modified.Damien George
2017-02-03tests/float: Add tests for zero to a negative power.Damien George
2017-02-03py/objcomplex: Correctly handle case of 0j to power of something.Damien George
0j to the power of negative now raises ZeroDivisionError, and 0j to the power of positive returns 0.
2017-02-03py/objfloat: Raise ZeroDivisionError for 0 to negative power.Damien George
2017-02-02tests/basics/set_binop: Add tests for inplace set operations.Damien George
2017-02-02py/objset: Make inplace binary operators actually modify the set.Damien George
2017-02-02tests/heapalloc_bytesio: Test for BytesIO with preallocates space.Paul Sokolovsky
2017-02-02py/objstringio: Allow to specify initial capacity by passing numeric argument.Paul Sokolovsky
E.g. uio.BytesIO(100) will allocate buffer with 100 bytes of space.
2017-02-01unix: Make stack be non-executableDave Hylands
This PR is to address issue #2812.
2017-02-01zephyr/README: Describe many gotchas of networked builds.Paul Sokolovsky
2017-02-01tests/thread: Fix stack size test so tests run reliably on baremetal.Damien George
2017-01-31lib/oofatfs/ffconf.h: Add MICROPY_FATFS_NORTC option.Andrew Gatt
2017-01-31stmhal: Fix build issue when MICROPY_PY_THREAD is disabled.Damien George
2017-01-31stmhal/main: Use _estack value to initialise stack extents.Damien George
2017-01-31stmhal: Initial implementation of multithreading, currently disabled.Damien George
This patch brings the _thread module to stmhal/pyboard. There is a very simple round-robin thread scheduler, which is disabled if there is only one thread (for efficiency when threading is not used). The scheduler currently switches threads at a rate of 250Hz using the systick timer and the pend-SV interrupt. The GIL is disabled so one must be careful to use lock objects to prevent concurrent access of objects. The threading is disabled by default, one can enabled it with the config option MICROPY_PY_THREAD to test it out.
2017-01-31tests/thread: Make thread_exc2 runable on baremetal.Damien George
2017-01-31stmhal/pendsv: Fill in comments about what the stack contains.Damien George