aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-12-22stmhal: Add pyb.irq_stats() to get statistics about IRQ calls.Damien George
Adds a lot of code, makes IRQs a bit less efficient, but is very useful for debugging. Usage: pyb.irq_stats() returns a memory view that can be read and written, eg: list(pyb.irq_stats()) pyb.irq_stats()[0] pyb.irq_stats()[0] = 0 The patch provides general IRQ_ENTER() and IRQ_EXIT() macros that can be modified to provide further IRQ statistics if desired.
2015-12-21esp8266: Remove superfluous includes.Paul Sokolovsky
2015-12-21esp8266/modesp: flash_read() takes 2 args (fix typo).Paul Sokolovsky
2015-12-21windows: Better handling of Ctrl-Cstijn
This builds upon the changes made in 2195046365c. Using signal() does not produce reliable results so SetConsoleCtrlHandler is used, and the handler is installed only once during initialization instead of removing it in mp_hal_set_interrupt_char when it is not strictly needed anymore, since removing it might lead to Ctrl-C events being missed because they are fired on a seperate thread which might only become alive after the handler was removed.
2015-12-20extmod/moduhashlib: Add namespace prefix for crypto-algorithms/sha256.h.Paul Sokolovsky
Everyone loves to names similar things the same, then there're conflicts between different libraries. The namespace prefix used is "CRYAL_", which is weird, and that's good, as that minimizes chance of another conflict.
2015-12-20tests: Add tests for %-formatting of bytes.Paul Sokolovsky
This requires CPython3.5, to not require switching to it, just use .exp file.
2015-12-20py/objstr: Applying % (format) operator to bytes should return bytes, not str.Paul Sokolovsky
2015-12-20py/objstr: Make sure that b"%s" % b"foo" uses undecorated bytes value.Paul Sokolovsky
I.e. the expected result for above is b"foo", whereas previously we got b"b'foo'".
2015-12-19py/mpprint: Fix printing of 64bit integers for 64bit windows buildsstijn
This makes all tests pass again for 64bit windows builds which would previously fail for anything printing ranges (builtin_range/unpack1) because they were printed as range( ld, ld ). This is done by reusing the mp_vprintf implementation for MICROPY_OBJ_REPR_D for 64bit windows builds (both msvc and mingw-w64) since the format specifier used for 64bit integers is also %lld, or %llu for the unsigned version. Note these specifiers used to be fetched from inttypes.h, which is the C99 way of working with printf/scanf in a portable way, but mingw-w64 wants to be backwards compatible with older MS C runtimes and uses the non-portable %I64i instead of %lld in inttypes.h, so remove the use of said header again in mpconfig.h and define the specifiers manually.
2015-12-19stmhal: Add mem8/mem16/mem32 operations to machine module.Dave Hylands
This uses the newly factored machine_mem functions.
2015-12-18stmhal: Change PLL configuration for STM32F7DISC.Fabian
Changes USB clock from 50MHz to 48MHz which improves USB communication.
2015-12-18windows: Add Appveyor CI builds for msvc port.stijn
Appveyor is like Travis, but for Windows builds. The appveyor.yml configuration will build the msvc port in all configuration/platform conbinations, and run the tests for each of those.
2015-12-18py/obj: Fix float constants for MICROPY_OBJ_REPR_C.Damien George
2015-12-18lib/libm: Allow math funcs to be used by non-Thumb archs.Damien George
Requires addition of software implementation of sqrtf function.
2015-12-18stmhal, cc3200: Actually implement machine -> umachine module weak link.Paul Sokolovsky
2015-12-18msvc: Add dirent.h/.c implementationstijn
This fixes the build after adding directory iteration in d874702
2015-12-18unix: machine_mem improvementsDave Hylands
This basically introduces the MICROPY_MACHINE_MEM_GET_READ_ADDR and MICROPY_MACHINE_MEM_GET_WRITE_ADDR macros. If one of them is not defined, then a default identity function is provided.
2015-12-18py/gc: When printing info, use %u instead of UINT_FMT for size_t args.Damien George
Ideally we'd use %zu for size_t args, but that's unlikely to be supported by all runtimes, and we would then need to implement it in mp_printf. So simplest and most portable option is to use %u and cast the argument to uint(=unsigned int). Note: reason for the change is that UINT_FMT can be %llu (size suitable for mp_uint_t) which is wider than size_t and prints incorrect results.
2015-12-18py: Add MICROPY_ENABLE_COMPILER and MICROPY_PY_BUILTINS_EVAL_EXEC opts.Damien George
MICROPY_ENABLE_COMPILER can be used to enable/disable the entire compiler, which is useful when only loading of pre-compiled bytecode is supported. It is enabled by default. MICROPY_PY_BUILTINS_EVAL_EXEC controls support of eval and exec builtin functions. By default they are only included if MICROPY_ENABLE_COMPILER is enabled. Disabling both options saves about 40k of code size on 32-bit x86.
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").