summaryrefslogtreecommitdiff
path: root/extmod
AgeCommit message (Collapse)Author
2017-08-25Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in ↵Dan Halbert
development) master. cpx build compiles and loads and works in repl; test suite not run yet esp8266 not tested yet
2017-08-21extmod/modubinascii: Don't post-increment variable that won't be used.Damien George
2017-08-21extmod,unix: For uos.stat interpret st_size member as an unsigned int.Damien George
This prevents large files (eg larger than 2gb on a 32-bit arch) from showing up as having a negative size. Fixes issue #3227.
2017-08-17extmod/modubinascii: Rewrite mod_binascii_a2b_base64.Alex Robbins
This implementation ignores invalid characters in the input. This allows it to decode the output of b2a_base64, and also mimics the behavior of CPython.
2017-08-16extmod/modussl_mbedtls.c: Add ussl.getpeercert() method.Eric Poulsen
Behaviour is as per CPython but only the binary form is implemented here. A test is included.
2017-08-13all: Raise exceptions via mp_raise_XXXJavier Candeira
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
2017-08-02py,extmod,stmhal: Use "static inline" for funcs that should be inline.Damien George
"STATIC inline" can expand to "inline" if STATIC is defined to nothing, and this case can lead to link errors.
2017-07-31extmod/modlwip: Implement setsockopt(IP_ADD_MEMBERSHIP).Paul Sokolovsky
Allows to join multicast groups.
2017-07-31all: Use the name MicroPython consistently in commentsAlexander Steffen
There were several different spellings of MicroPython present in comments, when there should be only one.
2017-07-31extmod: Use MP_ROM_INT for int values in an mp_rom_map_elem_t.Damien George
2017-07-29extmod/mod{lwip,onewire,webrepl}: Convert to mp_rom_map_elem_t.Paul Sokolovsky
2017-07-29extmod/modframebuf: Use correct initialization for .locals_dict.Paul Sokolovsky
2017-07-26extmod/machine_signal: Fix parsing of invert arg when Pin is first arg.Damien George
2017-07-26extmod/modussl_mbedtls: Implement non-blocking SSL sockets.Eric Poulsen
2017-07-25extmod/modframebuf: Consistently use "col" as name for colour variables.Damien George
Thanks to @kamikaze, aka Oleg Korsak, for the original idea and patch.
2017-07-25extmod/modussl_mbedtls: Make socket.close() free all TLS resources.Damien George
Also, use mp_stream_close() helper to close the underlying socket.
2017-07-25extmod/modframebuf: Fix invalid stride for odd widths in GS4_HMSB fmt.Radomir Dopieralski
Since the stride is specified in pixels, in a 4-bit horizontal format it has to always be even, otherwise the computation is wrong and we can write outside of the buffer sometimes.
2017-07-25extmod/modussl_mbedtls: When reading and peer wants to close, return 0.Damien George
If this particular code is returned then there's no more data, it's not really an error.
2017-07-24all: Don't include system errno.h when it's not needed.Damien George
2017-07-24extmod/modussl_mbedtls: Support server_side mode.Damien George
To use server_side mode one must pass valid values in the "key" and "cert" parameters.
2017-07-20extmod/modussl_axtls: Allow to close ssl stream multiple times.Paul Sokolovsky
Make sure that 2nd close has no effect and operations on closed streams are handled properly.
2017-07-19all: Remove trailing spaces, per coding conventions.Damien George
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2017-07-07py,extmod: Some casts and minor refactors to quiet compiler warnings.Tom Collins
2017-07-05extmod/modujson: Properly initialise temporary StringIO object.Damien George
2017-07-03extmod/modubinascii: Add check for empty buffer passed to hexlify.Damien George
Previous to this patch hexlify(b'', b':') would lead to a bad crash due to the computed length of the result being -1=0xffffffff.
2017-07-01extmod/modure: If input string is bytes, return bytes results too.Paul Sokolovsky
This applies to match.group() and split(). For ARM Thumb2, this increased code size by 12 bytes.
2017-06-27Split uos module into os and storage.Scott Shawcroft
os is a subset of CPython's os. storage contains additional file system mounting functionality based on UNIX's mount management. Fixes #140
2017-06-24extmod/moduzlib: decompress: Remove stale "(void)n_args".Paul Sokolovsky
n_args is now actually used in this function.
2017-06-22extmmod/modonewire: Rename public module to mp_module_onewire.Damien George
This follows naming scheme of other modules in extmod.
2017-06-22extmod: Move modonewire.c from esp8266 to extmod directory.Damien George
It's now generic enough to be used by any port.
2017-06-20Merge tag 'v1.9.1'2.0.0-alpha.0Scott Shawcroft
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions This release provides an important fix for the USB mass storage device in the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which is now require by some Operating Systems. There are also fixes for the lwIP bindings to improve non-blocking sockets and error codes. The VFS has some regressions fixed including the ability to statvfs the root. All changes are listed below. py core: - modbuiltins: add core-provided version of input() function - objstr: catch case of negative "maxsplit" arg to str.rsplit() - persistentcode: allow to compile with complex numbers disabled - objstr: allow to compile with obj-repr D, and unicode disabled - modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled - provide mp_decode_uint_skip() to help reduce stack usage - makeqstrdefs.py: make script run correctly with Python 2.6 - objstringio: if created from immutable object, follow copy on write policy extmod: - modlwip: connect: for non-blocking mode, return EINPROGRESS - modlwip: fix error codes for duplicate calls to connect() - modlwip: accept: fix error code for non-blocking mode - vfs: allow to statvfs the root directory - vfs: allow "buffering" and "encoding" args to VFS's open() - modframebuf: fix signed/unsigned comparison pendantic warning lib: - libm: use isfinite instead of finitef, for C99 compatibility - utils/interrupt_char: remove support for KBD_EXCEPTION disabled tests: - basics/string_rsplit: add tests for negative "maxsplit" argument - float: convert "sys.exit()" to "raise SystemExit" - float/builtin_float_minmax: PEP8 fixes - basics: convert "sys.exit()" to "raise SystemExit" - convert remaining "sys.exit()" to "raise SystemExit" unix port: - convert to use core-provided version of built-in import() - Makefile: replace references to make with $(MAKE) windows port: - convert to use core-provided version of built-in import() qemu-arm port: - Makefile: adjust object-file lists to get correct dependencies - enable micropython.mem_*() functions to allow more tests stmhal port: - boards: enable DAC for NUCLEO_F767ZI board - add support for NUCLEO_F446RE board - pass USB handler as parameter to allow more than one USB handler - usb: use local USB handler variable in Start-of-Frame handler - usb: make state for USB device private to top-level USB driver - usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command - convert from using stmhal's input() to core provided version cc3200 port: - convert from using stmhal's input() to core provided version teensy port: - convert from using stmhal's input() to core provided version esp8266 port: - Makefile: replace references to make with $(MAKE) - Makefile: add clean-modules target - convert from using stmhal's input() to core provided version zephyr port: - modusocket: getaddrinfo: Fix mp_obj_len() usage - define MICROPY_PY_SYS_PLATFORM (to "zephyr") - machine_pin: use native Zephyr types for Zephyr API calls docs: - machine.Pin: remove out_value() method - machine.Pin: add on() and off() methods - esp8266: consistently replace Pin.high/low methods with .on/off - esp8266/quickref: polish Pin.on()/off() examples - network: move confusingly-named cc3200 Server class to its reference - uos: deconditionalize, remove minor port-specific details - uos: move cc3200 port legacy VFS mounting functions to its ref doc - machine: sort machine classes in logical order, not alphabetically - network: first step to describe standard network class interface examples: - embedding: use core-provided KeyboardInterrupt object
2017-06-15all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.Damien George
2017-06-14extmod/modussl_axtls: Implement server_hostname arg to wrap_socket().Paul Sokolovsky
As enabled by SNI support in axTLS v2+.
2017-06-13extmod/modussl_axtls: Update for axTLS 2.1.3.Paul Sokolovsky
ssl_client_new() accepts new SSL_EXTENSIONS* argument.
2017-06-10extmod/modframebuf: Fix signed/unsigned comparison pendantic warning.Paul Sokolovsky
Happened with 32-bit gcc 4.8.4.
2017-06-07extmod/vfs: Allow "buffering" and "encoding" args to VFS's open().Damien George
These args are currently ignored but are parsed to make it easier to write portable scripts between CPython and MicroPython.
2017-06-07extmod/vfs: Allow to statvfs the root directory.Damien George
2017-06-04extmod/modlwip: accept: Fix error code for non-blocking mode.Paul Sokolovsky
In non-blocking mode, if no pending connection available, should return EAGAIN, not ETIMEDOUT.
2017-06-04extmod/modlwip: Fix error codes for duplicate calls to connect().Paul Sokolovsky
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
2017-06-03extmod/modlwip: connect: For non-blocking mode, return EINPROGRESS.Paul Sokolovsky
Instead of ETIMEDOUT. This is consistent with POSIX: http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
2017-05-29various: Spelling fixesVille Skyttä
2017-05-13extmod/vfs_fat_misc: Remove dot-dirs filter since FatFS already does it.Damien George
2017-05-12atmel-samd: Rework boot, main and REPL order.Scott Shawcroft
Boot will only run once now before USB is started. Its output goes to boot_out.txt. After main and REPL will run with VM and hardware resets between each.
2017-05-10extmod/vfs: Use MP_S_IFDIR, MP_S_IFREG consts instead of magic numbers.Damien George
2017-05-10extmod/vfs_fat: Replace listdir() with implementation of ilistdir().Damien George
VfsFat no longer has the listdir() method. Rather, if listdir() functionality is needed then one should use uos.listdir() which will call VfsFat.ilistdir().
2017-05-10extmod/vfs: Implement mp_vfs_ilistdir().Damien George
uos.ilistdir() is the core function, returning an iterator that yields 3-tuples. uos.listdir() is implemented in terms of ilistdir().
2017-05-05extmod/vfs: Allow a VFS to be mounted at the root dir.Damien George
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.
2017-05-01atmel-samd: Introduce audio sample playback via audioio.AudioOut.Scott Shawcroft
2017-05-01extmod/modlwip: ioctl POLL: Fix handling of peer closed socket.Paul Sokolovsky
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).