aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-11-16py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str.Damien George
This patch simplifies the str creation API to favour the common case of creating a str object that is not forced to be interned. To force interning of a new str the new mp_obj_new_str_via_qstr function is added, and should only be used if warranted. Apart from simplifying the mp_obj_new_str function (and making it have the same signature as mp_obj_new_bytes), this patch also reduces code size by a bit (-16 bytes for bare-arm and roughly -40 bytes on the bare-metal archs).
2017-11-16extmod/vfs: Use existing qstr for forward-slash string object.Damien George
2017-11-15tools/mpy-tool.py: Implement freezing of Ellipsis const object.Damien George
2017-11-15stm32/boards/NUCLEO_F429ZI: Incr CPU freq to 168MHz to get USB working.Damien George
At the original frequency of 90MHz there's no way to get a 48MHz USB clock. These new setting mirror those of the STM32F429DISC board.
2017-11-15py/mkenv.mk: Use $(PYTHON) consistently when calling Python tools.Christopher Arndt
Rationale: * Calling Python build tool scripts from makefiles should be done consistently using `python </path/to/script>`, instead of relying on the correct she-bang line in the script [1] and the executable bit on the script being set. This is more platform-independent. * The name/path of the Python executable should always be used via the makefile variable `PYTHON` set in `py/mkenv.mk`. This way it can be easily overwritten by the user with `make PYTHON=/path/to/my/python`. * The Python executable name should be part of the value of the makefile variable, which stands for the build tool command (e.g. `MAKE_FROZEN` and `MPY_TOOL`), not part of the command line where it is used. If a Python tool is substituted by another (non-python) program, no change to the Makefiles is necessary, except in `py/mkenv.mk`. * This also solves #3369 and #1616. [1] There are systems, where even the assumption that `/usr/bin/env` always exists, doesn't hold true, for example on Android (where otherwise the unix port compiles perfectly well).
2017-11-15py/emitnative: Clean up asm macro names so they have dest as first arg.Damien George
All the asm macro names that convert a particular architecture to a generic interface now follow the convention whereby the "destination" (usually a register) is specified first.
2017-11-14esp8266/esp8266_common.ld: Put .text of more libs into .irom0.text .Paul Sokolovsky
Recent vendor SDKs ship libs with code in .text section, which previously was going into .irom0.text. Adjust the linker script to route these sections back to iROM (follows upstream change).
2017-11-12extmod/moduhashlib: Enable SHA1 hashing when using "mbedtls" library.Christopher Cooper
The SHA1 hashing functionality is provided via the "axtls" library's implementation, and hence is unavailable when the "axtls" library is not being used. This change provides the same SHA1 hashing functionality when using the "mbedtls" library by using its implementation instead.
2017-11-12esp8266/README: Add section on using upip.Paul Sokolovsky
2017-11-12esp8266/README: Emphasize the need to change default WiFi password.Paul Sokolovsky
2017-11-12py/objnamedtuple: Add _asdict function if OrderedDict is supportedstijn
2017-11-11py/objtype: mp_obj_new_type: Name base types related vars more clearly.Paul Sokolovsky
As vars contains array of base types and its length, name them as such, avoid generic "items" and "len" names.
2017-11-10docs/_thread: Add a placeholder docs for _thread module.Paul Sokolovsky
Doesn't list specific API calls yet, the purpose is to let user know that the module exists.
2017-11-08py/mpconfig: Introduce reusable MP_HTOBE32(), etc. macros.Paul Sokolovsky
Macros to convert big-endian values to host byte order and vice-versa. These were defined in adhoc way for some ports (e.g. esp8266), allow reuse, provide default implementations, while allow ports to override.
2017-11-08docs/ure: Emphasize not supported features more.Paul Sokolovsky
Plus, additional descriptions/formatting.
2017-11-07unix/moduselect: Fix nanbox build after adding .dump() method.Paul Sokolovsky
2017-11-07unix/moduselect: Add .dump() method for debugging.Paul Sokolovsky
Commented out by default.
2017-11-05axtls: Update, exposes AES functions to implement ECB chiper mode.Paul Sokolovsky
2017-11-05esp8266/etshal.h: Make function prototypes compatible with ESP SDK 2.1.0+.Paul Sokolovsky
In the vendor SDK 2.1.0, some of the functions which previously didn't have prototypes, finally acquired them. Change prototypes on our side to match those in vendor headers, to avoid warnings-as-errors.
2017-11-04docs/ure: Add flags arg to ure.compile(), mention that ure.DEBUG is optional.Paul Sokolovsky
2017-11-02docs/esp8266/general: Minor grammar fixes.Paul Sokolovsky
2017-11-02extmod/modussl_axtls: Typo fix in comment.Paul Sokolovsky
2017-11-02extmod/modussl_axtls: socket_read: Handle EAGAIN.Paul Sokolovsky
If SSL_EAGAIN is returned (which is a feature of MicroPython's axTLS fork), return EAGAIN. Original axTLS returns SSL_OK both when there's no data to return to user yet and when the underlying stream returns EAGAIN. That's not distinctive enough, for example, original module code works well for blocking stream, but will infinite-loop for non-blocking socket with EAGAIN. But if we fix non-blocking case, blocking calls to .read() will return few None's initially (while axTLS progresses thru handshake). Using SSL_EAGAIN allows to fix non-blocking case without regressing the blocking one. Note that this only handles case of non-blocking reads of application data. Initial handshake and writes still don't support non-blocking mode and must be done in the blocking way.
2017-11-01zephyr/README: "make qemu" was replaced with "make run".Paul Sokolovsky
2017-11-01docs/esp8266/general: TLS limitations: Mention also "ussl" module limitations.Paul Sokolovsky
2017-11-01py/compile: Use alloca instead of qstr_build when compiling import name.Damien George
The technique of using alloca is how dotted import names are composed in mp_import_from and mp_builtin___import__, so use the same technique in the compiler. This puts less pressure on the heap (only the stack is used if the qstr already exists, and if it doesn't exist then the standard qstr block memory is used for the new qstr rather than a separate chunk of the heap) and reduces overall code size.
2017-11-01docs: Bump version to 1.9.3.Damien George
2017-11-01teensy: Get port compiling without any warnings.Damien George
2017-10-31docs/ure: Add "|" (alternative) to the list of supported operators.Paul Sokolovsky
2017-10-31Revert "py/{mkenv.mk,mkrules.mk}: Append .exe for Windows executable files."Damien George
This reverts commit 3289b9b7a76a1230b6bb631e191a47bfc6c7a8ee. The commit broke building on MINGW because the filename became micropython.exe.exe. A proper solution to support more Windows build environments requires more thought and testing.
2017-10-31docs/usocket: Document that settimeout() isn't supported by all ports.Paul Sokolovsky
And describe an alternative of using uselect.poll().
2017-10-30docs/esp8266/general: Add section on TLS limitations.Paul Sokolovsky
2017-10-30docs/ussl: Fix module name refs and use "MicroPython port" term.Paul Sokolovsky
2017-10-30extmod/modussl_mbedtls: Allow to compile with unix coverage build.Damien George
Fixes a few C warnings. No functional changes.
2017-10-30extmod/modussl: Add finaliser support for ussl objects.Eric Poulsen
Per the comment found here https://github.com/micropython/micropython-esp32/issues/209#issuecomment-339855157, this patch adds finaliser code to prevent memory leaks from ussl objects, which is especially useful when memory for a ussl context is allocated outside the uPy heap. This patch is in-line with the finaliser code found in many modsocket implementations for various ports. This feature is configured via MICROPY_PY_USSL_FINALISER and is disabled by default because there may be issues using it when the ussl state *is* allocated on the uPy heap, rather than externally.
2017-10-30docs/reference/isr_rules: Minor typo correction.Yuval Langer
2017-10-29lib/axtls: Update, support for SSL_EAGAIN return code.Paul Sokolovsky
A step towards implementing non-blocking stream support for SSL.
2017-10-28unix: Enable MICROPY_PY_REVERSE_SPECIAL_METHODS.Paul Sokolovsky
With inplace methods now disabled by default, it makes sense to enable reverse methods, as they allow for more useful features, e.g. allow for datetime module to implement both 2 * HOUR and HOUR * 2 (where HOUR is e.g. timedelta object).
2017-10-27py/objtype: Introduce MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS.Paul Sokolovsky
This allows to configure support for inplace special methods separately, similar to "normal" and reverse special methods. This is useful, because inplace methods are "the most optional" ones, for example, if inplace methods aren't defined, the operation will be executed using normal methods instead. As a caveat, __iadd__ and __isub__ are implemented even if MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS isn't defined. This is similar to the state of affairs before binary operations refactor, and allows to run existing tests even if MICROPY_PY_ALL_INPLACE_SPECIAL_METHODS isn't defined.
2017-10-27py/objtype: Define all special methods if requested.Paul Sokolovsky
If MICROPY_PY_ALL_SPECIAL_METHODS is defined, actually define all special methods (still subject to gating by e.g. MICROPY_PY_REVERSE_SPECIAL_METHODS). This adds quite a number of qstr's, so should be used sparingly.
2017-10-27docs/library/network: Add dhcp_hostname parameterJoar Wandborg
I have not actually tested this, going by information available in https://forum.micropython.org/viewtopic.php?t=2584
2017-10-27extmod/vfs: Replace VLA in proxy func with small, static sized array.Damien George
VLAs can be expensive on stack usage due to stack alignment requirements, and also the fact that extra local variables are needed to track the dynamic size of the stack. So using fixed-size arrays when possible can help to reduce code size and stack usage. In this particular case, the maximum value of n_args in the VLA is 2 and so it's more efficient to just allocate this array with a fixed size. This reduces code size by around 30 bytes on Thumb2 and Xtensa archs. It also reduces total stack usage of the function: on Thumb2 the usage with VLA is between 40 and 48 bytes, which is reduced to 32; on Xtensa, VLA usage is between 64 and 80 bytes, reduced to 32; on x86-64 it's at least 88 bytes reduced to 80.
2017-10-27docs/usocket: Document inet_ntop(), inet_pton().Paul Sokolovsky
2017-10-26docs/usocket: Elaborate descriptions.Paul Sokolovsky
Use the "usocket" module name everywhere. Use "MicroPython port" terminology. Suggest to avoid using IPPROTO_* constants in socket() call.
2017-10-26tests/net_inet: Update tls test to work with CPython and incl new site.Damien George
CPython only supports the server_hostname keyword arg via the SSLContext object, so use that instead of the top-level ssl.wrap_socket. This allows the test to run on CPython the same as uPy. Also add the "Host:" header to correctly make a GET request (for URLs that are hosted on other servers). This is not strictly needed to test the SSL connection but helps to debug things when printing the response.
2017-10-26docs/uselect: Document one-shot polling mode.Paul Sokolovsky
2017-10-24unix/modusocket: Remove #if MICROPY_SOCKET_EXTRA code blocks.Paul Sokolovsky
These defined couple of functions added during initial experimentation, which aren't part of MicroPython API and no longer used or needed.
2017-10-24all: Use NULL instead of "" when calling mp_raise exception helpers.Damien George
This is the established way of doing it and reduces code size by a little bit.
2017-10-23unix: Rename modsocket.c to modusocket.c.Paul Sokolovsky
Unix naming is historical, before current conventions were established. All other ports however have it as "modusocket.c", so rename for consistency and to avoid confusion.
2017-10-21py/objtype: Fit qstrs for special methods in byte type.Paul Sokolovsky
Update makeqstrdata.py to sort strings starting with "__" to the beginning of qstr list, so they get low qstr id's, guaranteedly fitting in 8 bits. Then use this property to further compact op_id => qstr mapping arrays.