aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-12-18py/emitglue: Add include of unistd.h for read function.Damien George
2015-12-18py/compile: Simplify compilation of comprehension iterators.Damien George
Saves 88 bytes on Thumb2, and 200 bytes on x86-64 archs.
2015-12-18ports: Rename "machine" module to "umachine".Paul Sokolovsky
To let unix port implement "machine" functionality on Python level, and keep consistent naming in other ports (baremetal ports will use magic module "symlinking" to still load it on "import machine"). Fixes #1701.
2015-12-18windows/windows_mphal: Add basic support for raising KeyboardInterrupt.Paul Sokolovsky
Compiles with mingw32, tested to work erratically under Wine due to not fully implemented emulation in it.
2015-12-18windows: Make keyboard_interrupt_obj available, it's standard feature.Paul Sokolovsky
2015-12-18unix/unix_mphal: Just consistently set sigaction.sa_flags to 0.Paul Sokolovsky
2015-12-17py/parse: Include stddef.h for definition of size_t.Damien George
2015-12-17unix/unix_mphal: Properly initialize struct sigaction.Paul Sokolovsky
This solves long-standing non-deterministic bug, which manifested itself on x86 32-bit (at least of reported cases) - segfault on Ctrl+C (i.e. SIGINT).
2015-12-17py/modgc: Remove obsolete extern declaration.Damien George
2015-12-17py/compile: Use size_t or uintptr_t instead of mp_uint_t.Damien George
2015-12-17py/parse: Replace mp_int_t/mp_uint_t with size_t etc, where appropriate.Damien George
2015-12-17py/qstr: Change type of qstr from mp_uint_t to size_t.Damien George
For builds where mp_uint_t is larger than size_t, it doesn't make sense to use such a wide type for qstrs. There can only be as many qstrs as there is address space on the machine, so size_t is the correct type to use. Saves about 3000 bytes of code size when building unix/ port with MICROPY_OBJ_REPR_D.
2015-12-17py/qstr: Use size_t instead of mp_uint_t when counting allocated bytes.Damien George
2015-12-17py/bc: Use size_t instead of mp_uint_t to count size of state and args.Damien George
2015-12-17py: Fix MICROPY_STACKLESS mode to compile with MICROPY_OBJ_REPR_D.Damien George
2015-12-17py/mpprint: Implement %llu and %lld format specifiers for mp_printf.Damien George
Only enabled for MICROPY_OBJ_REPR_D.
2015-12-16py/gc: Use size_t instead of mp_uint_t to count things related to heap.Damien George
size_t is the correct type to use to count things related to the size of the address space. Using size_t (instead of mp_uint_t) is important for the efficiency of ports that configure mp_uint_t to larger than the machine word size.
2015-12-16py/gc: For finaliser, interpret a pointer into the heap as concrete obj.Damien George
2015-12-16py/gc: Scan GC blocks as an array of pointers, not an array of objects.Damien George
The GC should search for pointers within the heap. This patch makes a difference when an object is larger than a pointer (eg 64-bit NaN boxing).
2015-12-16py/modsys: Fix module globals table to use MP_ROM_QSTR.Damien George
2015-12-16docs/library: Add network server example.danicampora
2015-12-16unix: Change define logic of _DIRENT_HAVE_D_INO to match other macros.Damien George
2015-12-16unix: Add FreeDos targetpohmelie
2015-12-16unix/modos: Fix silly bugs in ilistdir tuple creation.Damien George
2015-12-16unix/modos: Allow to configure use of d_ino using _DIRENT_HAVE_D_INO.Damien George
Ports will need to #define _DIRENT_HAVE_D_INO (0) to disable d_ino use.
2015-12-16stmhal/moduselect: Implement "oneshot polling" flag.Paul Sokolovsky
Similar to recently added feature in unix port: if event triggers for an objects, its polling flags are automatically reset, so it won't be polled until they are set again explicitly.
2015-12-16stmhal: Extend SPI support to fully support all SPI devices on STM32F429.Tobias Badertscher
This includes SPI4, SPI5 and SPI6.
2015-12-16uos: Add errno() function to get/set errno value.Paul Sokolovsky
2015-12-15msvc: Use new modmachine infrastructure per changes in f925165stijn
2015-12-14unix/modos: Implement ilistdir().Paul Sokolovsky
ilistdir() returns iterator which yields triples of (name, type, ino) where ino is inode number for entry's data, type of entry (file/dir/etc.), and name of file/dir. listdir() can be easily implemented in terms of this iterator (which is otherwise more efficient in terms of memory use and may save expensive call to stat() for each returned entry). CPython has os.scandir() which also returns an iterator, but it yields more complex objects of DirEntry type. scandir() can also be easily implemented in terms of ilistdir().
2015-12-14py/objpolyiter: Implement instance-polymorphic iterator type.Paul Sokolovsky
This allows to have single itertaor type for various internal iterator types (save rodata space by not having repeating almost-empty type structures). It works by looking "iternext" method stored in particular object instance (should be first object field after "base").
2015-12-14unix/modtime: Add strftime() function (only single argument is supported).Paul Sokolovsky
Following "don't rely on FFI for basic functionality" approach.
2015-12-13unix/moduselect: Make configurable with MICROPY_PY_USELECT.Paul Sokolovsky
2015-12-13unix: Move modmachine into unix directoryDave Hylands
This leaves behind the common functionality in extmod/machine_mem.c which can be used by all ports.
2015-12-12lib/utils/printf: Add vsnprintf alias for Clang.Paul Sokolovsky
Was reported to break MacOSX build.
2015-12-12stmhal: Make uart init use struct instead of array for parsing args.Damien George
This makes it much easier to understand which arg is which, less error prone, and simpler to add a new arg.
2015-12-12py/modmath: Add domain error checking to sqrt, log, log2, log10.Michael Buesch
These functions will raise 'ValueError: math domain error' on invalid input.
2015-12-12stmhal: For SPI config, use HW_SPIx_SCK instead of HW_ENABLE_SPIx.Damien George
Previously, SPI was configured by a board defining MICROPY_HW_ENABLE_SPIx to 0 or 1. Now, the board should define MICROPY_HW_SPIx_SCK, MISO, MOSI and NSS. This makes it the same as how I2C is configured.
2015-12-12py: Fix compiler to handle lambdas used as default arguments.Damien George
Addresses issue #1709.
2015-12-12tools: Upgrade upip to 0.6.3.Paul Sokolovsky
Updated for _os -> uos builtin module rename.
2015-12-12unix: Rename "_os" module to "uos" for consistency with baremetal ports.Paul Sokolovsky
2015-12-11msvc: Use different output directories depending on build typestijn
This allows multiple versions (e.g. Debug/Release, x86/x64) of micropython.exe to co-exist instead and also solves potential problems where msbuild does not completely rebuild the output and/or pdb files when switching between builds, which in turn can cause linker errors in dependent projects. By default exe/map/... files go in windows/build/$(Configuration)$(Platform) After each build micropython.exe is still copied from the above directory to the windows directory though, as that is consistent with the other ports and the test runner by default uses that location as well. Also rename env.props -> path.props which is a clearer name, and add ample documentation in the affected build files. (also see discussion in #1538)
2015-12-11unix/moduselect: Implement "one-shot" flag for poll.poll().Paul Sokolovsky
After an I/O event is triggered for fd, event flags are automatically reset, so no further events are reported until new event flags are set. This is an optimization for uasyncio, required to account for coroutine semantics: each coroutine issues explicit read/write async call, and once that trigger, no events should be reported to coroutine, unless it again explicitly requests it. One-shot mode saves one linear scan over the poll array.
2015-12-10stmhal: add order-only dependency on build directorySven Wegener
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2015-12-10tests: Add test for "not" of a user defined class.Damien George
2015-12-10py: Make UNARY_OP_NOT a first-class op, to agree with Py not semantics.Damien George
Fixes #1684 and makes "not" match Python semantics. The code is also simplified (the separate MP_BC_NOT opcode is removed) and the patch saves 68 bytes for bare-arm/ and 52 bytes for minimal/. Previously "not x" was implemented as !mp_unary_op(x, MP_UNARY_OP_BOOL), so any given object only needs to implement MP_UNARY_OP_BOOL (and the VM had a special opcode to do the ! bit). With this patch "not x" is implemented as mp_unary_op(x, MP_UNARY_OP_NOT), but this operation is caught at the start of mp_unary_op and dispatched as !mp_obj_is_true(x). mp_obj_is_true has special logic to test for truthness, and is the correct way to handle the not operation.
2015-12-10py/emitinlinethumb: Add support for MRS instruction.Henrik Sölver
Only IPSR and BASEPRI special registers supported at the moment, but easy to extend in the future.
2015-12-10lib/utils/printf: Apply workaround for static linking with uclibc.Paul Sokolovsky
uclibc objects call __GI_vsnprintf().
2015-12-10py/mkrules.mk: Don't pass COPT to linker.Paul Sokolovsky
Oftentimes, libc, libm, etc. don't come compiled with CPU compressed code option (Thumb, MIPS16, etc.), but we may still want to use such compressed code for MicroPython itself.
2015-12-09unix/modtermios: DJGPP appears to have unicode-capable cc_t type.Paul Sokolovsky
At least it's defined as "unsiged". We don't try to support unicode still, but at least apply workaround for DJGPP build.