summaryrefslogtreecommitdiff
path: root/extmod
AgeCommit message (Collapse)Author
2016-06-17extmod/modbtree: items(): Implement "end key inclusive" flag.Paul Sokolovsky
2016-06-16esp8266: Use RTC to set date & time stamps for files.Robert HH
The time stamp is taken from the RTC for all newly generated or changed files. RTC must be maintained separately. The dummy time stamp of Jan 1, 2000 is set in vfs.stat() for the root directory, avoiding invalid time values.
2016-06-16extmod/modbtree: Actually implement end key support for .items().Paul Sokolovsky
2016-06-16extmod/modbtree: Implement .items() iterator.Paul Sokolovsky
2016-06-15extmod/modbtree: Handle default value and error check.Paul Sokolovsky
2016-06-14extmod/modbtree: Initial implementation of "btree" module based on BerkeleyDB.Paul Sokolovsky
This implements basic wrapping of native get/put/seq API, and then dictionary access protocol. Native API is intended to be superceded going forward.
2016-05-31extmod/machine: Add MICROPY_PY_MACHINE_PULSE config for time_pulse_us.Damien George
Since not all ports that enable the machine module have the pin HAL functions.
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-31extmod/vfs_fat: Mark anused "self" arg for fat_vfs_stat().Paul Sokolovsky
2016-05-31extmod/vfs_fat.c: Add vfs.stat().Robert HH
The call to stat() returns a 10 element tuple consistent to the os.stat() call. At the moment, the only relevant information returned are file type and file size.
2016-05-29extmod/vfs_fat: getcwd(): Use mp_obj_new_exception_arg1().Paul Sokolovsky
Copy-paste issue, with the original mistake in stmhal.
2016-05-29extmod/vfs_fat: chdir(), getcwd() methods should accept VFS object (self).Paul Sokolovsky
2016-05-29extmod/vfs_fat: Add getcwd() method.Paul Sokolovsky
Ported from stmhal.
2016-05-29extmod/vfs_fat: Add chdir() method.Paul Sokolovsky
Ported from stmhal.
2016-05-27extmod/vfs_fat*: Replace text error messages by POSIX error numbers.Robert HH
These changes are in line with similar changes in other modules, and with standard Python interface.
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-26extmod/machine_i2c: Redo mp_hal_pin macros to use open_drain and od_low.Damien George
mp_hal_pin_config_od is renamed mp_hal_pin_open_drain, and mp_hal_pin_low is mp_hal_pin_od_low.
2016-05-26extmod/modussl: Coverage build fixes.Paul Sokolovsky
2016-05-26extmod/modussl: Make more compatible with non-default obj representations.Paul Sokolovsky
Still not compatible with nanboxing.
2016-05-20extmod/moduos_dupterm: Dumpterm subsystem is responsible for closing stream.Paul Sokolovsky
Make dupterm subsystem close a term stream object when EOF or error occurs. There's no other party than dupterm itself in a better position to do this, and this is required to properly reclaim stream resources, especially if multiple dupterm sessions may be established (e.g. as networking connections).
2016-05-20extmod/modwebrepl: Add close() method.Paul Sokolovsky
2016-05-20extmod/modwebsocket: Add close() method.Paul Sokolovsky
2016-05-20extmod: When including extmod headers, prefix path with extmod/.Damien George
2016-05-18py/stream: Support both "exact size" and "one underlying call" operations.Paul Sokolovsky
Both read and write operations support variants where either a) a single call is made to the undelying stream implementation and returned buffer length may be less than requested, or b) calls are repeated until requested amount of data is collected, shorter amount is returned only in case of EOF or error. These operations are available from the level of C support functions to be used by other C modules to implementations of Python methods to be used in user-facing objects. The rationale of these changes is to allow to write concise and robust code to work with *blocking* streams of types prone to short reads, like serial interfaces and sockets. Particular object types may select "exact" vs "once" types of methods depending on their needs. E.g., for sockets, revc() and send() methods continue to be "once", while read() and write() thus converted to "exactly" versions. These changes don't affect non-blocking handling, e.g. trying "exact" method on the non-blocking socket will return as much data as available without blocking. No data available is continued to be signaled as None return value to read() and write(). From the point of view of CPython compatibility, this model is a cross between its io.RawIOBase and io.BufferedIOBase abstract classes. For blocking streams, it works as io.BufferedIOBase model (guaranteeing lack of short reads/writes), while for non-blocking - as io.RawIOBase, returning None in case of lack of data (instead of raising expensive exception, as required by io.BufferedIOBase). Such a cross-behavior should be optimal for MicroPython needs.
2016-05-15extmod/modlwip: Rework how Python accept callback is called.Paul Sokolovsky
Calling it from lwIP accept callback will lead incorrect functioning and/or packet leaks if Python callback has any networking calls, due to lwIP non-reentrancy. So, instead schedule "poll" callback to do that, which will be called by lwIP when it does not perform networking activities. "Poll" callback is called infrequently though (docs say every 0.5s by default), so for better performance, lwIP needs to be patched to call poll callback soon after accept callback, but when current packet is already processed.
2016-05-12extmod/modlwip: Convert errno's to use MP_Exxx symbols.Damien George
2016-05-03extmod/modlwip: Implement sendall() method for TCP sockets.Paul Sokolovsky
2016-05-02extmod/modwebrepl: Get rid of using strncpy().Paul Sokolovsky
2016-04-30extmod/modwebrepl: Add support for password.Paul Sokolovsky
Request for password then becomes mandatory part of the protocol.
2016-04-29extmod/modwebrepl: Set debugging by default to off.Paul Sokolovsky
That's production setting. Also, extra UART output may affect behavior of (subpar) network drivers.
2016-04-29extmod/modwebrepl: Add rate-limiting workaround for broken network drivers.Paul Sokolovsky
Like ESP8266 has.
2016-04-29extmod/modwebrepl: Use bigger socket receive buffer.Paul Sokolovsky
The smaller chunks we send (and receive), the more packets there to receive, and higher chance to git internal packet buffer overflow in WiFi driver.
2016-04-29extmod/modwebrepl: More detailed debug output.Paul Sokolovsky
So detailed that even commented by default.
2016-04-29extmod/modwebrepl: GET_FILE: Send length-prefix chunk with one write().Paul Sokolovsky
A bit of optimization.
2016-04-29extmod/modwebrepl: Keep reading data when there's something to read.Paul Sokolovsky
EAGAIN should be returned only if underlying socket returned it. Wrap existing read function into external loop to process all data available.
2016-04-29extmod/modwebrepl: Initial implementation of "get file" operation.Paul Sokolovsky
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-28extmod/modussl: SSL_OK from ssl_read() means "no user data so far".Paul Sokolovsky
SSL_OK is numeric 0, and it's *not* an EOF. So, should keep reading.
2016-04-28extmod/modussl: Support server-side SSL sockets.Paul Sokolovsky
wrap_socket(sock, server_side=True)
2016-04-28extmod/modussl: Throw Python exceptions in case of errors.Paul Sokolovsky
2016-04-27extmod/modwebsocket: Handle CLOSE control frame.Paul Sokolovsky
This fixes situation when clients hangs waiting for disconnect and does so only on timeout.
2016-04-26extmod/modlwip: Add print_pcbs() debug function.Paul Sokolovsky
This requires lwIP built with LWIP_DEBUG (or it will be no-op).
2016-04-26extmod/modlwip: Workaround esp8266 sendto issue where 1 is returned.Damien George
2016-04-26extmod, stmhal: Fix typo of macro that detects if float is enabled.Damien George
2016-04-25extmod/modlwip: Protect recv/accept Python callback against exceptions.Paul Sokolovsky
Using usual call_function_*_protected() helper, to avoid NLR jump crashes.
2016-04-22extmod/machine_i2c: Allow mp_hal_pin_obj_t to be any type, not a ptr.Damien George
2016-04-17extmod/modlwip: Add ability to run callback on "recv" and "accept" events.Paul Sokolovsky
To use: .setsockopt(SOL_SOCKET, 20, lambda sock: print(sock)). There's a single underlying callback slot. For normal sockets, it serves as data received callback, for listening sockets - connection arrived callback.
2016-04-17extmod/modlwip: lwip_tcp_receive(): Full error handling.Paul Sokolovsky
2016-04-17extmod/modlwip: lwip_tcp_send(): Full error handling.Paul Sokolovsky
2016-04-14extmod/fsusermount: In mount/mkfs, deregister VFS object on error.Damien George
Should fix issue #1947.