aboutsummaryrefslogtreecommitdiff
path: root/extmod
AgeCommit message (Collapse)Author
2017-01-23extmod/modframebuf: Clip pixels drawn by line method.Damien George
2017-01-08extmod/modframebuf: optimize fill_rect subroutine callOleg Korsak
2017-01-04all: Consistently update signatures of .make_new and .call methods.Paul Sokolovsky
Otherwise, they serve reoccurring source of copy-paste mistakes and breaking nanbox build.
2016-12-24extmod/modutimeq: Make time_less_than be actually "less than", not less/eq.Paul Sokolovsky
This fixes an obvious case of non-fair scheduling of 2 tasks with the same deadline.
2016-12-23extmod/modutimeq: Fix printf in dump().Paul Sokolovsky
2016-12-22extmod/moduheapq: Revert change for adhoc relative-time queue support.Paul Sokolovsky
Now that specialized utimeq module has been implenented, revert previous adhoc changes to uheapq. This reverts commit 0cbc07227c4ab70c846f40a1e2a5fd57dec30428.
2016-12-22extmod/modutimeq: Fix warning about unused param.Paul Sokolovsky
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-22extmod/modutimeq: Copy of current moduheapq with timeq support for refactoring.Paul Sokolovsky
2016-12-09extmod/modframebuf: Store underlying buffer object to prevent GC free.Damien George
2016-12-08extmod/modframebuf: Make framebuf implement the buffer protocol.Damien George
So that one can easily access the underlying data of the frame buffer, eg to write the data out to a display.
2016-12-08extmod/machine_spi: Provide reusable software SPI class.Damien George
So long as a port defines relevant mp_hal_pin_xxx functions (and delay) it can make use of this software SPI class without the need for additional code.
2016-12-05extmod/modframebuf: Add hline, vline, rect and line methods.Damien George
These are basic drawing primitives. They work in a generic way on all framebuf formats by calling the underlying setpixel or fill_rect C-level primitives.
2016-12-05extmod/modbtree: Rename "sync" method to "flush" for consistency.Paul Sokolovsky
Rename recently introduced "sync" method to "flush" for consistency with usual files.
2016-12-02extmod/modbtree: Add method to sync the database.w4kpm
If you have longish operations on the db (such as logging data) it may be desirable to periodically sync the database to the disk. The added btree.sync() method merely exposes the berkley __bt_sync function to the user.
2016-12-02extmod/vfs_fat_file: Allow file obj to respond to ioctl flush request.w4kpm
2016-12-02extmod/modlwip: Add ioctl method to socket, with poll implementation.Damien George
Implementation of polling may need further fine tuning, but basic functionality works (tested on esp8266).
2016-12-02extmod/moduselect: Use configurable EVENT_POLL_HOOK instead of WFI.Damien George
To make moduselect be usable by any port.
2016-12-02extmod/moduselect: Use stream helper function instead of ad-hoc code.Damien George
2016-12-02py/stream: Move ad-hoc ioctl constants to stream.h and rename them.Damien George
The constants MP_IOCTL_POLL_xxx, which were stmhal-specific, are moved from stmhal/pybioctl.h (now deleted) to py/stream.h. And they are renamed to MP_STREAM_POLL_xxx to be consistent with other such constants. All uses of these constants have been updated.
2016-12-02extmod/vfs_fat: Implement POSIX behaviour of rename, allow to overwrite.Damien George
If the destination of os.rename() exists then it will be overwritten if it is a file. This is the POSIX behaviour, which is also the CPython behaviour, and so we follow suit. See issue #2598 for discussion.
2016-12-01extmod/modframebuf: Optimise fill and fill_rect methods.Damien George
Fill is a very common operation (eg to clear the screen) and it is worth optimising it, by providing a specialised fill_rect function for each framebuffer format. This patch improved the speed of fill by 10 times for a 16-bit display with 160*128 pixels.
2016-12-01extmod/modframebuf: Add back legacy FrameBuffer1 "class".Damien George
For backwards compatibility. It simple creates a frame buffer with the MVLSB format.
2016-12-01extmod/modframebuf: Make FrameBuffer handle 16bit depth.Radomir Dopieralski
Rename FrameBuffer1 into FrameBuffer and make it handle different bit depths via a method table that has getpixel and setpixel. Currently supported formats are MVLSB (monochrome, vertical, LSB) and RGB565. Also add blit() and fill_rect() methods.
2016-11-30extmod/modurandom: Allow to build with float disabled.Damien George
2016-11-24extmod/machine_i2c: Add hook to constructor to call port-specific code.Damien George
If MICROPY_PY_MACHINE_I2C_MAKE_NEW is defined then it is called when an I2C object is constructed with an id which is not -1.
2016-11-24extmod/machine_i2c: Expose soft I2C obj and readfrom/writeto funcs.Damien George
For external use by ports if needed.
2016-11-23extmod/machine_i2c: Remove trivial function wrappers.Damien George
2016-11-23extmod/machine_i2c: Add 'stop' argument to i2c readfrom/writeto meths.Damien George
2016-11-23extmod/machine_i2c: Make i2c.write[to] methods return num of ACKs recvd.Damien George
2016-11-23extmod/machine_i2c: Add 'nack' argument to i2c.readinto.Damien George
2016-11-23extmod/machine_i2c: Make C-level functions return -errno on I2C error.Damien George
2016-11-23extmod/machine_i2c: Remove unneeded i2c_write_mem/i2c_read_mem funcs.Damien George
2016-11-23extmod/machine_i2c: Rewrite mem xfer funcs in terms of C-level protocol.Damien George
2016-11-23extmod/machine_i2c: Rewrite i2c.scan in terms of C-level protocol.Damien George
2016-11-23extmod/machine_i2c: Add argument to C funcs to control stop generation.Damien George
2016-11-23extmod/machine_i2c: Add a C-level I2C-protocol, refactoring soft I2C.Damien George
2016-11-21extmod/moduselect: Fix comment describing endif.Damien George
2016-11-21extmod/machine_mem: Typo fix in comment.Paul Sokolovsky
2016-11-21stmhal/moduselect: Move to extmod/ for reuse by other ports.Paul Sokolovsky
2016-11-17extmod/machine_i2c: Release SDA on bus errorRadomir Dopieralski
2016-11-17extmod/machine_i2c: Raise an error when clock stretching times outRadomir Dopieralski
2016-11-17extmod/machine_i2c: Make the clock stretching timeout configurableRadomir Dopieralski
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: 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-14all: Remove readall() method, which is equivalent to read() w/o args.Paul Sokolovsky
Its addition was due to an early exploration on how to add CPython-like stream interface. It's clear that it's not needed and just takes up bytes in all ports.
2016-11-12extmod/moduheapq: Adhoc changes to support ordering by utime.ticks_ms().Paul Sokolovsky
As required for further elaboration of uasyncio, like supporting baremetal systems with wraparound timesources. This is not intended to be public interface, and likely will be further refactored in the future.
2016-11-03extmod/utime_mphal: ticks_diff/ticks_add: Don't hardcode 32-bit types.Paul Sokolovsky
Use normal mp_int_t/mp_uint_t types, algorithms (hm, formulas) can work with any type width.
2016-11-02extmod/utime_mphal: ticks_diff(): Optimize to avoid if conditions.Paul Sokolovsky
2016-10-30extmod/utime_mphal: Fix implementation of new semantics of ticks_diff().Paul Sokolovsky
Now the function properly uses ring arithmetic to return signed value in range (inclusive): [-MICROPY_PY_UTIME_TICKS_PERIOD/2, MICROPY_PY_UTIME_TICKS_PERIOD/2-1]. That means that function can properly process 2 time values away from each other within MICROPY_PY_UTIME_TICKS_PERIOD/2 ticks, but away in both directions. For example, if tick value 'a' predates tick value 'b', ticks_diff(a, b) will return negative value, and positive value otherwise. But at positive value of MICROPY_PY_UTIME_TICKS_PERIOD/2-1, the result of the function will wrap around to negative -MICROPY_PY_UTIME_TICKS_PERIOD/2, in other words, if a follows b in more than MICROPY_PY_UTIME_TICKS_PERIOD/2 - 1 ticks, the function will "consider" a to actually predate b.