aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2017-10-19py/objtype: Use CPython compatible method name for sizeof.Paul Sokolovsky
Per https://docs.python.org/3/library/sys.html#sys.getsizeof: getsizeof() calls the object’s __sizeof__ method. Previously, "getsizeof" was used mostly to save on new qstr, as we don't really support calling this method on arbitrary objects (so it was used only for reporting). However, normalize it all now.
2017-10-19py/argcheck: Remove #if guard around terse error message helper func.Damien George
Not all compilers/analysers are smart enough to realise that this function is never called if MICROPY_ERROR_REPORTING is not TERSE, because the logic in the code uses if statements rather than #if to select whether to call this function or not (MSC in debug mode is an example of this, but there are others). So just unconditionally compile this helper function. The code-base anyway relies on the linker to remove unused functions.
2017-10-19stm32: Make uos.dupterm() conform to specs by using extmod version.Damien George
The legacy function pyb.repl_uart() is still provided and retains its original behaviour (it only accepts a UART object). uos.dupterm() will now accept any object with write/readinto methods. At the moment there is just 1 dupterm slot.
2017-10-19stm32/mphalport: Improve efficiency of mp_hal_stdout_tx_strn_cooked.Damien George
Also simplifies the code by removing the specialised (and inefficient) cooked functions from UART and USB_VCP.
2017-10-19extmod/uos_dupterm: Swallow any errors from dupterm closing the stream.Damien George
Without this the board will crash when deactivating a stream that doesn't have a close() method (eg UART) or that raises an exception within the method (eg user-defined function).
2017-10-19README: Add gcc and arm-none-eabi-newlib to list of required components.Damien George
gcc is required for mpy-cross, and arm-none-eabi-newlib for ports using arm-none-eabi-gcc.
2017-10-17stm32/modnwwiznet5k: Implement stream ioctl for the Wiznet driver.Damien George
Now supports polling for read and write ability.
2017-10-17stm32/modnwwiznet5k: Increase SPI bus speed to 42MHz.Damien George
The W5200 and W5500 can support up to 80MHz so 42MHz (the maximum the pyboard can do in its standard configuration) should be safe. Tested to give around 1050000 kbytes/sec TCP download speed on a W5500, which is about 10% more than with the previous SPI speed of 21MHz.
2017-10-16docs/library/network: Update docs to state that W5500 is supported.Damien George
2017-10-16travis: Update build command now that stm32 Wiznet config has changed.Damien George
2017-10-16stm32/modnwwiznet5k: Add support for W5500 Ethernet chip.Damien George
Which Wiznet chip to use is a compile-time option: MICROPY_PY_WIZNET5K should be set to either 5200 or 5500 to support either one of these Ethernet chips. The driver is called network.WIZNET5K in both cases. Note that this commit introduces a breaking-change at the build level because previously the valid values for MICROPY_PY_WIZNET5K were 0 and 1 but now they are 0, 5200 and 5500.
2017-10-16drivers/wiznet5k: Get low-level W5500 driver working.Damien George
This patch implements the basic SPI read/write functions for the W5500 chip. It also allows _WIZCHIP_ to be configured externally to select the specific Wiznet chip.
2017-10-16drivers/wiznet5k: Improve the performance of socket ops with threading.Li Weiwei
Use MICROPY_THREAD_YIELD() instead of HAL_Delay in busy waiting to improve the performance of connect, send, recv, sento and recvfrom.
2017-10-16stm32/mpconfigport.h: Add MICROPY_THREAD_YIELD() macro.Li Weiwei
2017-10-16stm32/modusocket: Return OSError(-2) if getaddrinfo fails.Damien George
This matches the behaviour of getaddrinfo in extmod/modlwip.c.
2017-10-16stm32/modusocket: Make getaddrinfo() work when passed an IP address.Damien George
2017-10-16stm32/modnwwiznet5k: Implement WIZNET5K.isconnected() method.Damien George
2017-10-15README: Add explicit section on contributing.Paul Sokolovsky
To increase visibility of Contributors' Guidelines and Code Conventions docs.
2017-10-13extmod/uos_dupterm: Update uos.dupterm() and helper funcs to have index.Damien George
The uos.dupterm() signature and behaviour is updated to reflect the latest enhancements in the docs. It has minor backwards incompatibility in that it no longer accepts zero arguments. The dupterm_rx helper function is moved from esp8266 to extmod and generalised to support multiple dupterm slots. A port can specify multiple slots by defining the MICROPY_PY_OS_DUPTERM config macro to an integer, being the number of slots it wants to have; 0 means to disable the dupterm feature altogether. The unix and esp8266 ports are updated to work with the new interface and are otherwise unchanged with respect to functionality.
2017-10-13stm32/usbd_cdc_interface.h: Fix code comments after recent refactor.Li Weiwei
2017-10-13stm32/usbd_cdc_interface: Don't reset CDC output buf on initialisation.Damien George
So that characters can be buffered before the USB device is connected (restoring behviour of the driver before recent state refactoring).
2017-10-12py/emitnative: Simplify binary op emitter, no need to check inplace ops.Damien George
2017-10-11py/emitnative: Implement floor-division and modulo for viper emitter.Damien George
2017-10-11esp8266/modules/webrepl_setup: Add info about allowed password length.Vitor Massaru Iha
This patch also makes the code more concise by combining the checks for the password length.
2017-10-11docs/library: Add missing cross-ref links for classes in pyb module.Mike Causer
2017-10-11py/modbuiltins: Use existing utf8_get_char helper in builtin ord func.Damien George
2017-10-10py/formatfloat: Use standard isinf, isnan funcs instead of custom ones.Damien George
Reduces code size by a tiny bit.
2017-10-10py/formatfloat: Don't print the negative sign of a NaN value.Damien George
NaN may have the sign bit set but it has no meaning, so don't print it out.
2017-10-10lib/libm: Remove implementation of log2f, use MP_NEED_LOG2 instead.Damien George
2017-10-10py/modmath: Convert log2 macro into a function.Damien George
So that a pointer to it can be passed as a pointer to math_generic_1. This patch also makes the function work for single and double precision floating point.