8649 Commits (ef61b5ecb59e9b4e37e3e3c023c62d583c23eb16)

Author SHA1 Message Date
Dan Halbert ef61b5ecb5 Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.
cpx build compiles and loads and works in repl; test suite not run yet
esp8266 not tested yet
6 years ago
Scott Shawcroft 266be30777 atmel-samd: Introduce a nvm module for non-volatile byte-level memory access. (#203)
* atmel-samd: Introduce a nvm module for non-volatile byte-level memory access.

This allows for persisting small configuration values even when the file system
is read-only from CircuitPython.

Fixes #160

* Review feedback:
* Add tests.
* Fix non-zero index.
* Fix len()
6 years ago
Dan Halbert dd1c4fc8c7 Workaround readthedocs bug 6 years ago
Scott Shawcroft 774bf0cf0a tools: Always upload to Rosie from Travis. (#200)
This allows Rosie to automatically work for commits to forks.
6 years ago
Dan Halbert 74cfdeb316 Added ability to freeze multiple directories; freeze neopixel library in cpx build (#199)
Reworked frozen module support: clean up makefiles and handle multiple directories.
Modules to freeze are included as git submodules.

Add neopixel to circuitplayground express build.

Fixes #56
6 years ago
Damien George 1f78e7a431 docs: Bump version to 1.9.2. 6 years ago
Damien George f9ecaa132f py/asmthumb: Use existing macro to properly clear the D-cache.
This macro is provided by stmhal/mphalport.h and makes sure the addr and
size arguments are correctly aligned.
6 years ago
Scott Shawcroft 16ef611b0b shared-bindings: Check that extra args aren't provided to digitalio.DigitalInOut on construction. (#189) 6 years ago
Scott Shawcroft f570b53d44 shared-bindings: Update DigitalIO.pull docs and validate that third (#188)
state is None and not anything.

Fixes #187
6 years ago
Scott Shawcroft 45a31b1c2a Fix ADC input def for PB07. (#195)
Fixes #194
6 years ago
Paul Sokolovsky 64a3c52f66 docs: Consistently link to micropython-lib in glossary. 6 years ago
Ein Terakawa ab2c64cc76 esp8266: Fix UART stop bit constants.
As per the "ESP8266 Technical Reference".
6 years ago
Damien George 1c6b442d32 extmod/modubinascii: Don't post-increment variable that won't be used. 6 years ago
Damien George f5309fc4ff py/formatfloat: Don't post-increment variable that won't be used again. 6 years ago
Damien George 103ae43f95 py/objcomplex: Remove unnecessary assignment of variable. 6 years ago
Damien George ad6aae13a4 py/compile: Remove unused pn_colon code when compiling func params. 6 years ago
Damien George 4ec803a42a all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros. 6 years ago
Damien George 4c736ea8fc extmod,unix: For uos.stat interpret st_size member as an unsigned int.
This prevents large files (eg larger than 2gb on a 32-bit arch) from
showing up as having a negative size.  Fixes issue #3227.
6 years ago
Damien George b16a755a0b py/mkrules.mk: Use "find -path" when searching for frozen obj files.
This allows the command to succeed without error even if there is no
$(BUILD)/build directory, which is the case for mpy-cross.
6 years ago
Paul Sokolovsky e3383e9352 py/stream: seek: Consistently handle negative offset for SEEK_SET.
Per POSIX, this is EINVAL, so raises OSError(EINVAL).
6 years ago
Paul Sokolovsky 0cd9ab7755 py/objstringio: Fix regression with handling SEEK_SET.
For SEEK_SET, offset should be treated as unsigned, to allow full-width
stream sizes (e.g. 32-bit instead of 31-bit). This is now fully documented
in stream.h. Also, seek symbolic constants are added.
6 years ago
Tom Collins 168350cd98 py/objstringio: Prevent offset wraparound for io.BytesIO objects.
Too big positive, or too big negative offset values could lead to overflow
and address space wraparound and thus access to unrelated areas of memory
(a security issue).
6 years ago
Paul Sokolovsky 387a8d26f9 docs/glossary: Fix typos in micropython-lib paragraph. 6 years ago
Paul Sokolovsky 46583e9057 docs/glossary: Elaborate on possible MicroPython port differences.
State that this doc describes generic, "core" MicroPython functionality,
any particular port may diverge in both directions, by both omitting
some functionality, and adding more, both cases described outside the
generic documentation.
6 years ago
Paul Sokolovsky 3f91570483 docs/library/usocket: Describe complete information on address formats.
Describe that the only portable way to deal with addresses is by using
getaddrinfo(). Describe that some ports may support tuple addresses using
"socket" module (vs "usocket" of native MicroPython).
6 years ago
Paul Sokolovsky ccaad53270 docs/library/usocket: Move socket.error to its own section.
It's too minor a point to start the module description with it.
6 years ago
Paul Sokolovsky 478887c62f zephyr/modzephyr: Add shell_net_iface() function.
Calls out to Zephyr's shell, submodule "net", command "iface", and shows
network interface information (if CONFIG_NET_SHELL is enabled).
6 years ago
Paul Sokolovsky 394c536675 zephyr/prj_96b_carbon.conf: Re-enable networking on Carbon.
The original issue leading to crash on startup if no default network
interface was presented, was resolved some time ago.

Note that this enables generic networking subsystem, not networking
on Carbon.
6 years ago
Paul Sokolovsky 09b561f108 zephyr/modusocket: Update struct sockaddr family field name.
Was changed to "sa_family" for POSIX compatibility.
6 years ago
Alex Robbins 0aa1d3f447 docs/library/ubinascii: Update base64 docs.
This clarifies return values and the handling of invalid (e.g. newline)

Encoding conforms to RFC 3548, but decoding does not, as it ignores invalid
characters in base64 input. Instead, it conforms to MIME handling of base64
(RFC 2045).

Note that CPython doesn't document handling of invalid characters in
a2b_base64() docs:
https://docs.python.org/3/library/binascii.html#binascii.a2b_base64 , so
we specify it more explicitly than it, based on CPython's actual behavior
(with which MicroPython now compliant).
6 years ago
Alex Robbins c89254fd0f extmod/modubinascii: Rewrite mod_binascii_a2b_base64.
This implementation ignores invalid characters in the input. This allows
it to decode the output of b2a_base64, and also mimics the behavior of
6 years ago
Damien George 025e5f2b33 py/binary: Change internal bytearray typecode from 0 to 1.
The value of 0 can't be used because otherwise mp_binary_get_size will let
a null byte through as the type code (intepreted as byterray).  This can
lead to invalid type-specifier strings being let through without an error
in the struct module, and even buffer overruns.
6 years ago
Tony DiCola c281b44cbd Update docs README to mention requirement for recommonmark dependency. 6 years ago
stijn e4ab404780 tools/mpy-tool.py: Fix missing argument in dump() function
This makes the -d commandline argument usable again.
Pass empty string as parent name as listing starts from the root.
6 years ago
Paul Sokolovsky 9404093606 zephyr/prj_base.conf: Enable CONFIG_INIT_STACKS.
As required for zephyr.stack_analyze().
6 years ago
Paul Sokolovsky ad937c49aa zephyr/modzephyr: Add current_tid() and stacks_analyze() functions.
current_tid() returns current thread ID. stacks_analyze() calls
k_call_stacks_analyze() which, with CONFIG_INIT_STACKS enabled,
will print stack usage for some well-known threads in the system.
6 years ago
Eric Poulsen d5191edf7f extmod/modussl_mbedtls.c: Add ussl.getpeercert() method.
Behaviour is as per CPython but only the binary form is implemented here.
A test is included.
6 years ago
Scott Shawcroft e00b3190ed Have the build script upload artifacts to Rosie when travis is building a pull request. (#191) 6 years ago
Stefan Naumann ace9fb5405 py: Add verbose debug compile-time flag MICROPY_DEBUG_VERBOSE.
It enables all the DEBUG_printf outputs in the py/ source code.
6 years ago
Bas van Sisseren a14ce77b28 py/binary.c: Fix bug when packing big-endian 'Q' values.
Without bugfix:

    struct.pack('>Q', 16)

With bugfix:

    struct.pack('>Q', 16)
6 years ago
Javier Candeira c127ace28a docs/library/machine.RTC.rst: Fix typo. 6 years ago
Javier Candeira 35a1fea90b all: Raise exceptions via mp_raise_XXX
- 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.
6 years ago
Damien George b6a3289564 tools/mpy-tool.py: Don't generate const_table if it's empty. 6 years ago
Scott Shawcroft fab634e3ee Turn on Rosie CI testing to test new builds on real hardware.
This introduces a skip_if module that can be used by tests to
determine when they should be skipped due to the environment.

Some tests have been split in order to have finer grained skip
6 years ago
Paul Sokolovsky bfc2092dc5 py/modsys: Initial implementation of sys.getsizeof().
Implemented as a new MP_UNARY_OP. This patch adds support lists, dicts and
6 years ago
Damien George 7d4a2f773c all: Make use of $(TOP) variable in Makefiles, instead of "..".
$(TOP) is defined in py/mkenv.mk and should be used to refer to the top
level of this repository.
6 years ago
Damien George f9dfd8aa3b minimal,esp8266,pic16bit: Remove unused stmhal include from Makefile. 6 years ago
Scott Shawcroft f6a702538a py: Pretend frozen files are stored under .frozen rather than the empty path.
This makes it clear when frozen modules are loaded as opposed to the empty path
which represents the current working directory. Furthermore, by splitting the two
apart this allows one to control in what order frozen modules are loaded.

This is a prerequisite for #56.
6 years ago
Scott Shawcroft 5c32a5aa6a py: Remove mpy-cross depend when making frozen mpy's because we don't know the state under which its being built. Instead, build it before running the subsequent make. 6 years ago
Scott Shawcroft 42156484ae shared-bindings/atmel-samd: Fix and improve trigger duration timing on PulseIn.resume. 6 years ago