- 01 Nov, 2017 2 commits
-
-
Damien George authored
-
Damien George authored
-
- 31 Oct, 2017 2 commits
-
-
Paul Sokolovsky authored
-
Damien George authored
This reverts commit 3289b9b7. 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.
-
- 30 Oct, 2017 6 commits
-
-
Paul Sokolovsky authored
And describe an alternative of using uselect.poll().
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Damien George authored
Fixes a few C warnings. No functional changes.
-
Eric Poulsen authored
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.
-
Yuval Langer authored
-
- 29 Oct, 2017 1 commit
-
-
Paul Sokolovsky authored
A step towards implementing non-blocking stream support for SSL.
-
- 28 Oct, 2017 1 commit
-
-
Paul Sokolovsky authored
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).
-
- 27 Oct, 2017 4 commits
-
-
Paul Sokolovsky authored
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.
-
Paul Sokolovsky authored
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.
-
Joar Wandborg authored
I have not actually tested this, going by information available in https://forum.micropython.org/viewtopic.php?t=2584
-
Damien George authored
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.
-
- 26 Oct, 2017 3 commits
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Use the "usocket" module name everywhere. Use "MicroPython port" terminology. Suggest to avoid using IPPROTO_* constants in socket() call.
-
Damien George authored
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.
-
- 25 Oct, 2017 1 commit
-
-
Paul Sokolovsky authored
-
- 24 Oct, 2017 2 commits
-
-
Paul Sokolovsky authored
These defined couple of functions added during initial experimentation, which aren't part of MicroPython API and no longer used or needed.
-
Damien George authored
This is the established way of doing it and reduces code size by a little bit.
-
- 23 Oct, 2017 1 commit
-
-
Paul Sokolovsky authored
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.
-
- 21 Oct, 2017 1 commit
-
-
Paul Sokolovsky authored
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.
-
- 19 Oct, 2017 6 commits
-
-
Paul Sokolovsky authored
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.
-
Damien George authored
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.
-
Damien George authored
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.
-
Damien George authored
Also simplifies the code by removing the specialised (and inefficient) cooked functions from UART and USB_VCP.
-
Damien George authored
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).
-
Damien George authored
gcc is required for mpy-cross, and arm-none-eabi-newlib for ports using arm-none-eabi-gcc.
-
- 17 Oct, 2017 2 commits
-
-
Damien George authored
Now supports polling for read and write ability.
-
Damien George authored
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.
-
- 16 Oct, 2017 8 commits
-
-
Damien George authored
-
Damien George authored
-
Damien George authored
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.
-
Damien George authored
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.
-
Li Weiwei authored
Use MICROPY_THREAD_YIELD() instead of HAL_Delay in busy waiting to improve the performance of connect, send, recv, sento and recvfrom.
-
Li Weiwei authored
-
Damien George authored
This matches the behaviour of getaddrinfo in extmod/modlwip.c.
-
Damien George authored
-