aboutsummaryrefslogtreecommitdiff
path: root/py/py.mk
AgeCommit message (Collapse)Author
2017-01-30extmod/vfs_fat: Remove MICROPY_READER_FATFS component.Damien George
2017-01-29extmod/machine_signal: Implement "signal" abstraction for machine module.Paul Sokolovsky
A signal is like a pin, but ca also be inverted (active low). As such, it abstracts properties of various physical devices, like LEDs, buttons, relays, buzzers, etc. To instantiate a Signal: pin = machine.Pin(...) signal = machine.Signal(pin, inverted=True) signal has the same .value() and __call__() methods as a pin.
2017-01-27extmod: Add generic VFS sub-system.Damien George
This provides mp_vfs_XXX functions (eg mount, open, listdir) which are agnostic to the underlying filesystem type, and just require an object with the relevant filesystem-like methods (eg .mount, .open, .listidr) which can then be mounted. These mp_vfs_XXX functions would typically be used by a port to implement the "uos" module, and mp_vfs_open would be the builtin open function. This feature is controlled by MICROPY_VFS, disabled by default.
2017-01-27py/py.mk: Add CFLAGS_MOD flag to set config file for FatFs.Damien George
2017-01-22py: Add builtin help function to core, with default help msg.Damien George
This builtin is configured using MICROPY_PY_BUILTINS_HELP, and is disabled by default.
2016-12-22extmod/modutimeq: Refactor into optimized class.Paul Sokolovsky
import utimeq, utime # Max queue size, the queue allocated statically on creation q = utimeq.utimeq(10) q.push(utime.ticks_ms(), data1, data2) res = [0, 0, 0] # Items in res are filled up with results q.pop(res)
2016-12-09py: Add inline Xtensa assembler.Damien George
This patch adds the MICROPY_EMIT_INLINE_XTENSA option, which, when enabled, allows the @micropython.asm_xtensa decorator to be used. The following opcodes are currently supported (ax is a register, a0-a15): ret_n() callx0(ax) j(label) jx(ax) beqz(ax, label) bnez(ax, label) mov(ax, ay) movi(ax, imm) # imm can be full 32-bit, uses l32r if needed and_(ax, ay, az) or_(ax, ay, az) xor(ax, ay, az) add(ax, ay, az) sub(ax, ay, az) mull(ax, ay, az) l8ui(ax, ay, imm) l16ui(ax, ay, imm) l32i(ax, ay, imm) s8i(ax, ay, imm) s16i(ax, ay, imm) s32i(ax, ay, imm) l16si(ax, ay, imm) addi(ax, ay, imm) ball(ax, ay, label) bany(ax, ay, label) bbc(ax, ay, label) bbs(ax, ay, label) beq(ax, ay, label) bge(ax, ay, label) bgeu(ax, ay, label) blt(ax, ay, label) bnall(ax, ay, label) bne(ax, ay, label) bnone(ax, ay, label) Upon entry to the assembly function the registers a0, a12, a13, a14 are pushed to the stack and the stack pointer (a1) decreased by 16. Upon exit, these registers and the stack pointer are restored, and ret.n is executed to return to the caller (caller address is in a0). Note that the ABI for the Xtensa emitters is non-windowing.
2016-12-09py: Integrate Xtensa assembler into native emitter.Damien George
The config option MICROPY_EMIT_XTENSA can now be enabled to target the Xtensa architecture with @micropython.native and @micropython.viper decorators.
2016-11-28py: Factor out common code from assemblers into asmbase.[ch].Damien George
All assemblers should "derive" from mp_asm_base_t.
2016-11-21stmhal/moduselect: Move to extmod/ for reuse by other ports.Paul Sokolovsky
2016-11-16py/lexer: Rewrite mp_lexer_new_from_fd in terms of mp_reader.Damien George
2016-11-16py/lexer: Provide generic mp_lexer_new_from_file based on mp_reader.Damien George
If a port defines MICROPY_READER_POSIX or MICROPY_READER_FATFS then lexer.c now provides an implementation of mp_lexer_new_from_file using the mp_reader_new_file function.
2016-11-16py/lexer: Rewrite mp_lexer_new_from_str_len in terms of mp_reader_mem.Damien George
2016-11-16py: Factor out persistent-code reader into separate files.Damien George
Implementations of persistent-code reader are provided for POSIX systems and systems using FatFS. Macros to use these are MICROPY_READER_POSIX and MICROPY_READER_FATFS respectively. If an alternative implementation is needed then a port can define the function mp_reader_new_file.
2016-11-16py: Factor persistent code load/save funcs into persistentcode.[ch].Damien George
2016-11-15py/*.mk: Replace uses of 'sed' with $(SED).Damien George
2016-11-08py: Move frozen bytecode Makefile rules from ports to common mk files.Damien George
Now, to use frozen bytecode all a port needs to do is define FROZEN_MPY_DIR to the directory containing the .py files to freeze, and define MICROPY_MODULE_FROZEN_MPY and MICROPY_QSTR_EXTRA_POOL.
2016-10-26extmod/moduos_dupterm: Renamed to uos_dupterm.Paul Sokolovsky
As part of file naming clean up (moduos_dupterm doesn't implement a full module, so should skip "mod" prefix, similar to other files in extmod/).
2016-10-21py/py.mk: Automatically add frozen.c to source list if FROZEN_DIR is defined.Paul Sokolovsky
Now frozen modules generation handled fully by py.mk and available for reuse by any port.
2016-10-14extmod/utime_mphal: Factor out implementations in terms of mp_hal_* for reuse.Paul Sokolovsky
As long as a port implement mp_hal_sleep_ms(), mp_hal_ticks_ms(), etc. functions, it can just use standard implementations of utime.sleel_ms(), utime.ticks_ms(), etc. Python-level functions.
2016-09-23py/py.mk: Add support for building modussl_mbedtls.Paul Sokolovsky
2016-09-22py/py.mk: Suppress some compiler warnings when building berkeley-db.Damien George
2016-09-05py: Add MICROPY_USE_INTERNAL_PRINTF option, defaults to enabled.Delio Brignoli
This new config option allows to control whether MicroPython uses its own internal printf or not (if not, an external one should be linked in). Accompanying this new option is the inclusion of lib/utils/printf.c in the core list of source files, so that ports no longer need to include it themselves.
2016-09-01extmod: Add machine_spi with generic SPI C-protocol and helper methods.Damien George
The idea is that all ports can use these helper methods and only need to provide initialisation of the SPI bus, as well as a single transfer function. The coding pattern follows the stream protocol and helper methods.
2016-07-31py/py.mk: Extra switches to build "embedded" BerkeleyDB BTree lib.Paul Sokolovsky
2016-07-30lib/embed/abort_: Implementation of abort_() function raising uPy exception.Paul Sokolovsky
Helpful when porting existing C libraries to MicroPython. abort()ing in embedded environment isn't a good idea, so when compiling such library, -Dabort=abort_ option can be given to redirect standard abort() to this "safe" version.
2016-07-16esp8266: Cache Xtensa-built libaxtls.a in local build dir.Paul Sokolovsky
Allows to build the library variant for other archs in parallel.
2016-07-13extmod/modussl_axtls: Further changes to allow alternative SSL modules.Paul Sokolovsky
Make variable MICROPY_SSL_AXTLS=1 should be defined to activate modussl_axtls and link with -laxtls.
2016-07-13extmod/modussl: Rename to modussl_axtls.c, to allow impl using other SSL libs.Paul Sokolovsky
2016-06-28py: Add basic _thread module, with ability to start a new thread.Damien George
2016-06-18extmod/machine_pinbase: Implementation of PinBase class.Paul Sokolovsky
Allows to translate C-level pin API to Python-level pin API. In other words, allows to implement a pin class and Python which will be usable for efficient C-coded algorithms, like bitbanging SPI/I2C, time_pulse, etc.
2016-06-15py: Support to build berkeley db 1.85 and "btree" module.Paul Sokolovsky
2016-05-31extmod: Add machine time_pulse_us function (at C and Python level).Damien George
The C implementation is taken from the DHT driver.
2016-05-27extmod/virtpin: Initial implementation of open-ended C-level Pin interface.Paul Sokolovsky
Using usual method of virtual method tables. Single virtual method, ioctl, is defined currently for all operations. This universal and extensible vtable-based method is also defined as a default MPHAL GPIO implementation, but a specific port may override it with its own implementation (e.g. close-ended, but very efficient, e.g. avoiding virtual method dispatch).
2016-05-10py: Add uerrno module, with errno constants and dict.Damien George
2016-04-29extmod/modwebrepl: Module to handle WebREPL protocol.Paul Sokolovsky
While just a websocket is enough for handling terminal part of WebREPL, handling file transfer operations requires demultiplexing and acting upon, which is encapsulated in _webrepl class provided by this module, which wraps a websocket object.
2016-04-25py: Move call_function_*_protected() functions to py/ for reuse.Paul Sokolovsky
They almost certainly needed by any C code which calls Python callbacks.
2016-04-16py/py.mk: Add makefile variable for qstr autogeneration control.Jan Čapek
- any architecture may explicitely build with qstring make QSTR_AUTOGEN_DISABLE=1 autogeneration disabled and provide its own list of qstrings by the standard mechanisms (qstrdefsport.h).
2016-04-16py: Add rules for automated extraction of qstrs from sources.Jan Čapek
- add template rule that converts a specified source file into a qstring file - add special rule for generating a central header that contains all extracted/autogenerated strings - defined by QSTR_DEFS_COLLECTED variable. Each platform appends a list of sources that may contain qstrings into a new build variable: SRC_QSTR. Any autogenerated prerequisities are should be appened to SRC_QSTR_AUTO_DEPS variable. - remove most qstrings from py/qstrdefs, keep only qstrings that contain special characters - these cannot be easily detected in the sources without additional annotations - remove most manual qstrdefs, use qstrdef autogen for: py, cc3200, stmhal, teensy, unix, windows, pic16bit: - remove all micropython generic qstrdefs except for the special strings that contain special characters (e.g. /,+,<,> etc.) - remove all port specific qstrdefs except for special strings - append sources for qstr generation in platform makefiles (SRC_QSTR)
2016-04-12extmod: Add generic machine.I2C class, with bit-bang I2C.Damien George
Should work on any machine that provides the correct pin functions.
2016-04-12extmod: Add initial framebuf module.Damien George
2016-03-24extmod/modwebsocket: Start module for WebSocket helper functions.Paul Sokolovsky
Currently, only write support is implemented (of limited buffer size).
2016-03-03extmod/vfs_fat: Add lexer, move from stmhal port for reuse.Paul Sokolovsky
2016-02-28extmod/vfs_fat: Move listdir() method from stmhal for reuse.Paul Sokolovsky
2016-02-15extmod/vfs_fat_ffconf: Reusable FatFs module, move from stmhal/ffconf.Paul Sokolovsky
TODO: Probably merge into vfs_fat_diskio.
2016-02-15extmod/vfs_fat_file: Reusable FatFs module, move from stmhal/file.Paul Sokolovsky
2016-02-15extmod/vfs_fat_diskio: Reusable FatFs module, move from stmhal/diskio.Paul Sokolovsky
2016-02-14unix: Enable VfsFat support.Paul Sokolovsky
2016-01-17extmod/modurandom: Add "urandom" module.Paul Sokolovsky
Seedable and reproducible pseudo-random number generator. Implemented functions are getrandbits(n) (n <= 32) and seed(). The algorithm used is Yasmarang by Ilya Levin: http://www.literatecode.com/yasmarang
2016-01-01extmod/moduos_dupterm: Make uos.dupterm() implementation reusable.Paul Sokolovsky
That's just function which sets/gets dup terminal object, and can be easily reused across ports.