summaryrefslogtreecommitdiffstatshomepage
path: root/extmod
Commit message (Collapse)AuthorAge
* extmod/modframebuf: Fix signed/unsigned comparison pendantic warning.Paul Sokolovsky2017-06-10
| | | | Happened with 32-bit gcc 4.8.4.
* extmod/vfs: Allow "buffering" and "encoding" args to VFS's open().Damien George2017-06-07
| | | | | These args are currently ignored but are parsed to make it easier to write portable scripts between CPython and MicroPython.
* extmod/vfs: Allow to statvfs the root directory.Damien George2017-06-07
|
* extmod/modlwip: accept: Fix error code for non-blocking mode.Paul Sokolovsky2017-06-04
| | | | | In non-blocking mode, if no pending connection available, should return EAGAIN, not ETIMEDOUT.
* extmod/modlwip: Fix error codes for duplicate calls to connect().Paul Sokolovsky2017-06-04
| | | | | | | | If socket is already connected, POSIX requires returning EISCONN. If connection was requested, but not yet complete (for non-blocking socket), error code is EALREADY. http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
* extmod/modlwip: connect: For non-blocking mode, return EINPROGRESS.Paul Sokolovsky2017-06-03
| | | | | Instead of ETIMEDOUT. This is consistent with POSIX: http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
* various: Spelling fixesVille Skyttä2017-05-29
|
* extmod/vfs_fat_misc: Remove dot-dirs filter since FatFS already does it.Damien George2017-05-13
|
* extmod/vfs: Use MP_S_IFDIR, MP_S_IFREG consts instead of magic numbers.Damien George2017-05-10
|
* extmod/vfs_fat: Replace listdir() with implementation of ilistdir().Damien George2017-05-10
| | | | | | VfsFat no longer has the listdir() method. Rather, if listdir() functionality is needed then one should use uos.listdir() which will call VfsFat.ilistdir().
* extmod/vfs: Implement mp_vfs_ilistdir().Damien George2017-05-10
| | | | | uos.ilistdir() is the core function, returning an iterator that yields 3-tuples. uos.listdir() is implemented in terms of ilistdir().
* extmod/vfs: Allow a VFS to be mounted at the root dir.Damien George2017-05-05
| | | | | | | This patch allows mounting of VFS objects right at the root directory, eg os.mount(vfs, '/'). It still allows VFS's to be mounted at a path within the root, eg os.mount(vfs, '/flash'), and such mount points will override any paths within a VFS that is mounted at the root.
* extmod/modlwip: ioctl POLL: Fix handling of peer closed socket.Paul Sokolovsky2017-05-01
| | | | | | | | | | Peer-closed socket is both readable and writable: read will return EOF, write - error. Without this poll will hang on such socket. Note that we don't return POLLHUP, based on argumentation in http://www.greenend.org.uk/rjk/tech/poll.html that it should apply to deeper disconnects, for example for networking, that would be link layer disconnect (e.g. WiFi went down).
* extmod/modlwip: getaddrinfo: Allow to accept all 6 standard params.Paul Sokolovsky2017-04-29
| | | | But warn if anything else but host/port is passed.
* extmod/moduselect: Implement ipoll() method for alloc-free polling.Paul Sokolovsky2017-04-29
| | | | Similar to the implementation added to unix port module previously.
* extmod/moduselect: Refactor towards introduction of poll.ipoll().Paul Sokolovsky2017-04-29
| | | | This follows previous refactor made to unix/moduselect.
* extmod/moduselect: Convert to MP_ROM_QSTR and friends.Paul Sokolovsky2017-04-29
|
* extmod/crypto-algorithms/sha256: Remove non-standard memory.h header.Paul Sokolovsky2017-04-27
|
* extmod/moductypes: Fix bigint handling for 32-bit ports.Paul Sokolovsky2017-04-21
|
* extmod/machine_signal: Rename "inverted" arg to "invert", it's shorter.Damien George2017-04-15
| | | | | | | A shorter name takes less code size, less room in scripts and is faster to type at the REPL. Tests and HW-API examples are updated to reflect the change.
* extmod/machine_signal: Support all Pin's arguments to the constructor.Paul Sokolovsky2017-04-11
| | | | | | | | | | | | | | | | | This implements the orginal idea is that Signal is a subclass of Pin, and thus can accept all the same argument as Pin, and additionally, "inverted" param. On the practical side, it allows to avoid many enclosed parenses for a typical declararion, e.g. for Zephyr: Signal(Pin(("GPIO_0", 1))). Of course, passing a Pin to Signal constructor is still supported and is the most generic form (e.g. Unix port will only support such form, as it doesn't have "builtin" Pins), what's introduces here is just practical readability optimization. "value" kwarg is treated as applying to a Signal (i.e. accounts for possible inversion).
* extmod/modframebuf: Make monochrome bitmap formats start with MONO_.Peter Hinch2017-04-04
| | | | | | | | MONO_xxx is much easier to read if you're not familiar with the code. MVLSB is deprecated but kept for backwards compatibility, for the time being. This patch also updates the associated docs and tests.
* all: Use full path name when including mp-readline/timeutils/netutils.Damien George2017-03-31
| | | | | | | This follows the pattern of how all other headers are now included, and makes it explicit where the header file comes from. This patch also removes -I options from Makefile's that specify the mp-readline/timeutils/ netutils directories, which are no longer needed.
* modutimeq: Add peektime() function (provisional).Jan Pochyla2017-03-29
| | | | | | | | | | | Allows to get event time for a head item in the queue. The usecase if waiting for the next event *OR* I/O completion. I/O completion may happen before event triggers, and then wait should continue for the remaining event time (or I/O completion may schedule another earlier event altogether). The new function has a strongly provisional status - it may be converted to e.g. peek() function returning all of the event fields, not just time.
* extmod: Update for changes to mp_obj_str_get_data.Damien George2017-03-29
|
* extmod/moduselect: Update to use size_t for array accessor.Damien George2017-03-29
|
* extmod/vfs_fat: Fix calculation of total blocks in statvfs.Damien George2017-03-29
|
* extmod/modlwip: Use mp_obj_str_get_str instead of mp_obj_str_get_data.Damien George2017-03-26
|
* extmod/utime_mphal: Don't exit/enter the GIL in generic sleep functions.Damien George2017-03-22
| | | | | | GIL behaviour should be handled by the port. And ports probably want to define sleep_us so that it doesn't release the GIL, to improve timing accuracy.
* extmod/modframebuf: Add support for monochrome horizontal format.Peter Hinch2017-03-20
| | | | | MHLSB and MHMSB formats are added to the framebuf module, which have 8 adjacent horizontal pixels represented in a single byte.
* py: Allow lexer to raise exceptions during construction.Damien George2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the error handling in the lexer, to simplify it (ie reduce code size). A long time ago, when the lexer/parser/compiler were first written, the lexer and parser were designed so they didn't use exceptions (ie nlr) to report errors but rather returned an error code. Over time that has gradually changed, the parser in particular has more and more ways of raising exceptions. Also, the lexer never really handled all errors without raising, eg there were some memory errors which could raise an exception (and in these rare cases one would get a fatal nlr-not-handled fault). This patch accepts the fact that the lexer can raise exceptions in some cases and allows it to raise exceptions to handle all its errors, which are for the most part just out-of-memory errors during construction of the lexer. This makes the lexer a bit simpler, and also the persistent code stuff is simplified. What this means for users of the lexer is that calls to it must be wrapped in a nlr handler. But all uses of the lexer already have such an nlr handler for the parser (and compiler) so that doesn't put any extra burden on the callers.
* extmod/vfs: Rewrite path lookup algo to support relative paths from root.Damien George2017-03-13
| | | | | | | For example, if the current directory is the root dir then this patch allows one to do uos.listdir('mnt'), where 'mnt' is a valid mount point. Previous to this patch such a thing would not work, on needed to do uos.listdir('/mnt') instead.
* extmod/vfs_fat: Allow to compile with MICROPY_VFS_FAT disabled.Damien George2017-03-13
| | | | | Some ports may want to compile with generic MICROPY_VFS support but without the VfsFat class. This patch allows such a thing.
* extmod/vfs_fat: Remove obsolete and unused str/len members.Damien George2017-03-10
|
* extmod/modutimeq: Make scheduling fair (round-robin).Paul Sokolovsky2017-03-07
| | | | | | | By adding back monotonically increasing field in addition to time field. As heapsort is not stable, without this, among entried added and readded at the same time instant, some might be always selected, and some might never be selected, leading to scheduling starvation.
* extmod/modurandom: Use mp_raise_ValueError().Paul Sokolovsky2017-02-24
| | | | | For the standard unix x86_64 build, this saves 11 bytes on object file level, but no difference in executable size due to (bloaty) code alignment.
* py: Add iter_buf to getiter type method.Damien George2017-02-16
| | | | | | | | | | | | | | | Allows to iterate over the following without allocating on the heap: - tuple - list - string, bytes - bytearray, array - dict (not dict.keys, dict.values, dict.items) - set, frozenset Allows to call the following without heap memory: - all, any, min, max, sum TODO: still need to allocate stack memory in bytecode for iter_buf.
* extmod/modlwip: Add my copyright.Paul Sokolovsky2017-02-15
| | | | | | | | | Per: $ git log modlwip.c |grep ^Auth | sort | uniq -c 9 Author: Damien George 2 Author: Galen Hazelwood 43 Author: Paul Sokolovsky
* extmod/vfs: Allow to stat the root directory.Damien George2017-02-13
| | | | | os.stat('/') now works and returns a mostly-empty tuple. Really all that is useful is the mode which tells that it's a directory.
* extmod/vfs: Raise OSError(EEXIST) on attempt to mkdir a mount point.Damien George2017-02-09
|
* extmod/vfs: Allow to mount a block device, not just a VFS object.Damien George2017-02-09
| | | | | | | If the mounted object doesn't have a "mount" method then assume it's a block device and try to detect the filesystem. Since we currently only support FAT filesystems, the behaviour is to just try and create a VfsFat object automatically, using the given block device.
* extmod/machine_signal: Implement Signal .on() and .off() methods.Paul Sokolovsky2017-02-08
| | | | | | | Each method asserts and deasserts signal respectively. They are equivalent to .value(1) and .value(0) but conceptually simpler (and may help to avoid confusion with inverted signals, where "asserted" state means logical 0 output).
* extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func.Damien George2017-02-06
| | | | | | | | | | | SPI needs to be fast, and calling the EVENT_POLL_HOOK every byte makes it unusable for ports that need to do non-trivial work in the EVENT_POLL_HOOK call. And individual SPI transfers should be short enough in time that EVENT_POLL_HOOK doesn't need to be called. If something like this proves to be needed in practice then we will need to introduce separate event hook macros, one for "slow" loops (eg select/poll) and one for "fast" loops (eg software I2C, SPI).
* extmod/machine_pulse: Make time_pulse_us() not throw exceptions.Paul Sokolovsky2017-02-05
| | | | | | | | | | | | machine.time_pulse_us() is intended to provide very fine timing, including while working with signal bursts, where each transition is tracked in row. Throwing and handling an exception may take too much time and "signal loss". So instead, in case of a timeout, just return negative value. Cases of timeout while waiting for initial signal stabilization, and during actual timing, are recognized. The documentation is updated accordingly, and rewritten somewhat to clarify the function behavior.
* extmod/vfs_fat.c: Use explicit include path for timeutils.h.Andrew Gatt2017-01-30
|
* extmod/vfs_reader: Fix use of NLR by popping context.Damien George2017-01-30
|
* extmod/vfs_fat: Remove unused function fat_vfs_listdir.Damien George2017-01-30
|
* extmod/vfs_fat: Remove unused fatfs_builtin_open function.Damien George2017-01-30
|
* extmod: Merge old fsusermount.h header into vfs.h and vfs_fat.h.Damien George2017-01-30
| | | | | vfs.h is for generic VFS declarations, and vfs_fat.h is for VfsFat specific things.
* extmod/vfs_fat: Remove MICROPY_FATFS_OO config option.Damien George2017-01-30
| | | | | Everyone should now be using the new ooFatFs library. The old one is no longer supported and will be removed.