- 31 Oct, 2015 1 commit
-
-
Damien George authored
py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
-
- 17 Oct, 2015 1 commit
-
-
Paul Sokolovsky authored
Another function (like stat) which is problematic to deal with on ABI level (FFI), as struct statvfs layout may differ unpredictably between OSes and even different versions of a same OS. So, implement it in C, returning a 10-element tuple of f_bsize, f_frsize, f_blocks, f_bfree, f_bavail, f_files, f_ffree, f_favail, f_flag, f_namemax. This is exactly the order described in Python3 docs, https://docs.python.org/3/library/os.html#os.statvfs (but note that os.statvfs() should make these values available as attributes).
-
- 14 Oct, 2015 3 commits
-
-
Damien George authored
-
Damien George authored
See issue #1500.
-
Paul Sokolovsky authored
Bionic libc in Android 1.5 missed log2() and nan() functions.
-
- 15 Sep, 2015 1 commit
-
-
Tom Soulanille authored
Configurable with MICROPY_PY_BUILTINS_SLICE_ATTRS. Disabled by default.
-
- 12 Sep, 2015 1 commit
-
-
Damien George authored
-
- 11 Sep, 2015 1 commit
-
-
Paul Sokolovsky authored
This includes Android Dalvik VM for example. Example usage: import jni System = jni.cls("java/lang/System") System.out.println("Hello, Java!")
-
- 05 Aug, 2015 1 commit
-
-
blmorris authored
This change allows micropython to return the same value as CPython for sys.platform
-
- 26 Jul, 2015 1 commit
-
-
Tom Soulanille authored
Disabled by default. Adds 108 bytes to Thumb2 arch when enabled.
-
- 08 Jul, 2015 1 commit
-
-
Paul Sokolovsky authored
This requires root access. And on recent Linux kernels, with CONFIG_STRICT_DEVMEM option enabled, only address ranges listed in /proc/iomem can be accessed. The above compiled-time option can be however overriden with boot-time option "iomem=relaxed". This also removed separate read/write paths - there unlikely would be a case when they're different.
-
- 01 Jun, 2015 1 commit
-
-
Paul Sokolovsky authored
MicroPython doesn't come with standard library included, so it is important to be able to easily install needed package in a seamless manner. Bundling package manager (upip) inside an executable solves this issue. upip is bundled only with standard executable, not "minimal" or "fast" builds.
-
- 27 May, 2015 1 commit
-
-
Damien George authored
This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
-
- 17 May, 2015 1 commit
-
-
Paul Sokolovsky authored
This reverts commit 8fbabab1. Turned to cause problems on MacOSX.
-
- 10 May, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 08 May, 2015 1 commit
-
-
Paul Sokolovsky authored
Make thumb2 have priority over arm.
-
- 04 May, 2015 2 commits
-
-
Paul Sokolovsky authored
From https://docs.python.org/3/library/constants.html#NotImplemented : "Special value which should be returned by the binary special methods (e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. __imul__(), __iand__(), etc.) for the same purpose. Its truth value is true." Some people however appear to abuse it to mean "no value" when None is a legitimate value (don't do that).
-
Paul Sokolovsky authored
Refactored from "stm" module, provides mem8, mem16, mem32 objects with array subscript syntax.
-
- 25 Apr, 2015 1 commit
-
-
Paul Sokolovsky authored
The implementation is very basic and non-compliant and provided solely for CPython compatibility. The function itself is bad Python2 heritage, its usage is discouraged.
-
- 16 Apr, 2015 1 commit
-
-
Damien George authored
Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
-
- 03 Apr, 2015 1 commit
-
-
Paul Sokolovsky authored
splitlines() occurs ~179 times in CPython3 standard library, so was deemed worthy to implement. The method has subtle semantic differences from just .split("\n"). It is also defined as working for any end-of-line combination, but this is currently not implemented - it works only with LF line-endings (which should be OK for text strings on any platforms, but not OK for bytes).
-
- 02 Apr, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 26 Mar, 2015 1 commit
-
-
stijn authored
Disabled by default. Enabled on unix and windows ports.
-
- 20 Mar, 2015 2 commits
-
-
stijn authored
Disabled by default. Enabled on unix and stmhal ports.
-
Paul Sokolovsky authored
Given that there's already support for "fixed table" maps, which are essentially ordered maps, the implementation of OrderedDict just extends "fixed table" maps by adding an "is ordered" flag and add/remove operations, and reuses 95% of objdict code, just making methods tolerant to both dict and OrderedDict. Some things are missing so far, like CPython-compatible repr and comparison. OrderedDict is Disabled by default; enabled on unix and stmhal ports.
-
- 14 Mar, 2015 1 commit
-
-
Damien George authored
These allow to fine-tune the compiler to select whether it optimises tuple assignments of the form a, b = c, d and a, b, c = d, e, f. Sensible defaults are provided.
-
- 13 Mar, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 03 Mar, 2015 1 commit
-
-
Damien George authored
-
- 27 Feb, 2015 1 commit
-
-
Paul Sokolovsky authored
This is rarely used feature which takes enough code to implement, so is controlled by MICROPY_PY_ARRAY_SLICE_ASSIGN config setting, default off. But otherwise it may be useful, as allows to update arbitrary-sized data buffers in-place. Slice is yet to implement, and actually, slice assignment implemented in such a way that RHS of assignment should be array of the exact same item typecode as LHS. CPython has it more relaxed, where RHS can be any sequence of compatible types (e.g. it's possible to assign list of int's to a bytearray slice). Overall, when all "slice write" features are implemented, it may cost ~1KB of code.
-
- 22 Feb, 2015 1 commit
-
-
Damien George authored
The implementation of these functions is very large (order 4k) and they are rarely used, so we don't enable them by default. They are however enabled in stmhal and unix, since we have the room.
-
- 30 Jan, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 16 Jan, 2015 1 commit
-
-
Damien George authored
-
- 14 Jan, 2015 1 commit
-
-
Damien George authored
Native code has GC-heap pointers in it so it must be scanned. But on unix port memory for native functions is mmap'd, and so it must have explicit code to scan it for root pointers.
-
- 10 Jan, 2015 1 commit
-
-
Damien George authored
Compiler optimises lookup of module.CONST when enabled (an existing feature). Disabled by default; enabled for unix, windows, stmhal. Costs about 100 bytes ROM on stmhal.
-
- 09 Jan, 2015 2 commits
-
-
Damien George authored
This allows to enable mem-info functions in micropython module, even if MICROPY_MEM_STATS is not enabled. In this case, you get mem_info and qstr_info but not mem_{total,current,peak}.
-
Damien George authored
-
- 07 Jan, 2015 2 commits
-
-
Damien George authored
This is a simple optimisation inspired by JITing technology: we cache in the bytecode (using 1 byte) the offset of the last successful lookup in a map. This allows us next time round to check in that location in the hash table (mp_map_t) for the desired entry, and if it's there use that entry straight away. Otherwise fallback to a normal map lookup. Works for LOAD_NAME, LOAD_GLOBAL, LOAD_ATTR and STORE_ATTR opcodes. On a few tests it gives >90% cache hit and greatly improves speed of code. Disabled by default. Enabled for unix and stmhal ports.
-
Damien George authored
This patch consolidates all global variables in py/ core into one place, in a global structure. Root pointers are all located together to make GC tracing easier and more efficient.
-
- 01 Jan, 2015 1 commit
-
-
Paul Sokolovsky authored
-
- 16 Dec, 2014 1 commit
-
-
Paul Sokolovsky authored
Name choosen per latest conventions and for compatibiity with stmhal port.
-