aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-07-02docs/ure: Document some more supported regex operators.Damien George
2018-07-02docs/ure: Document sub(), groups(), span(), start() and end().Damien George
2018-07-02unix/mpconfigport_coverage: Enable ure groups, span, start, end and sub.Damien George
2018-07-02extmod/modure: Add ure.sub() function and method, and tests.Damien George
This feature is controlled at compile time by MICROPY_PY_URE_SUB, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.
2018-07-02extmod/modure: Add match.span(), start() and end() methods, and tests.Damien George
This feature is controlled at compile time by MICROPY_PY_URE_MATCH_SPAN_START_END, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.
2018-07-02extmod/modure: Add match.groups() method, and tests.Damien George
This feature is controlled at compile time by MICROPY_PY_URE_MATCH_GROUPS, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.
2018-06-28docs/uos: Make it clear that block device block_num param is an index.Damien George
2018-06-28esp8266/esp8266_common.ld: Put mp_keyboard_interrupt in iRAM.Damien George
This function may be called from a UART IRQ, which may interrupt the system when it is erasing/reading/writing flash. In such a case all code executing from the IRQ must be in iRAM (because the SPI flash is busy), so put mp_keyboard_interrupt in iRAM so ctrl-C can be caught during flash access. This patch also takes get_fattime out of iRAM and puts it in iROM to make space for mp_keyboard_interrupt. There's no real need to have get_fattime in iRAM because it calls other functions in iROM. Fixes issue #3897.
2018-06-27py/compile: Handle return/break/continue correctly in async with.Damien George
Before this patch the context manager's __aexit__() method would not be executed if a return/break/continue statement was used to exit an async with block. async with now has the same semantics as normal with. The fix here applies purely to the compiler, and does not modify the runtime at all. It might (eventually) be better to define new bytecode(s) to handle async with (and maybe other async constructs) in a cleaner, more efficient way. One minor drawback with addressing this issue purely in the compiler is that it wasn't possible to get 100% CPython semantics. The thing that is different here to CPython is that the __aexit__ method is not looked up in the context manager until it is needed, which is after the body of the async with statement has executed. So if a context manager doesn't have __aexit__ then CPython raises an exception before the async with is executed, whereas uPy will raise it after it is executed. Note that __aenter__ is looked up at the beginning in uPy because it needs to be called straightaway, so if the context manager isn't a context manager then it'll still raise an exception at the same location as CPython. The only difference is if the context manager has the __aenter__ method but not the __aexit__ method, then in that case uPy has different behaviour. But this is a very minor, and acceptable, difference.
2018-06-27tests: Move non-filesystem io tests to basics dir with io_ prefix.Damien George
2018-06-27esp8266/mpconfigport.h: Enable ucryptolib module for standard build.Damien George
It remains disabled for the 512k build.
2018-06-27extmod/moducryptolib: Don't include arpa/inet.h, it's not needed.Damien George
And some ports (eg esp8266) don't have it.
2018-06-27esp32/mpconfigport.h: Enable ucryptolib module.Damien George
2018-06-27extmod/moducryptolib: Shorten exception messages to reduce code size.Yonatan Goldschmidt
2018-06-27extmod/moducryptolib: Prefix all Python methods/objects with ucryptolib.Yonatan Goldschmidt
Follows what was done in b045ebd35 for uhashlib.
2018-06-27extmod/moducryptolib: Add an mbedTLS implementation for this module.Yonatan Goldschmidt
2018-06-27extmod/moducryptolib: Refactor functions for clean interface with axTLS.Yonatan Goldschmidt
This will allow implementations other than axTLS. This commit includes additions of checks and clarifications of exceptions related to user input. To make the interface cleaner, I've disallowed switching from encrypt to decrypt in the same object, as this is not always possible with other crypto libraries (not all libraries have AES_convert_key like axTLS).
2018-06-27extmod/moducryptolib: Optionally export MODE_* constants to Python.Yonatan Goldschmidt
Allow including crypto consts based on compilation settings. Disabled by default to reduce code size; if one wants extra code readability, can enable them.
2018-06-27zephyr: Rename CONFIG_CONSOLE_PULL to CONFIG_CONSOLE_SUBSYS.Damien George
Following a similar change in the Zephyr Project.
2018-06-27docs/usocket: Minor fixes to grammar of getaddrinfo.Damien George
2018-06-27zephyr/prj_qemu_x86.conf: Remove outdated CONFIG_RAM_SIZE.Paul Sokolovsky
Target RAM size is no longer set using Kconfig options, but instead using DTS (device tree config). Fortunately, the default is now set to a high value, so we don't need to use DTS fixup.
2018-06-27zephyr/prj_base.conf: Remove outdated CONFIG_NET_NBUF_RX_COUNT option.Paul Sokolovsky
CONFIG_NET_NBUF_RX_COUNT no longer exists in Zephyr, for a while. That means we build with the default RX buf count for a while too, and it works, so just remove it (instead of switching to what it was renamed to, CONFIG_NET_PKT_RX_COUNT).
2018-06-27tests/basics/namedtuple*: Import ucollections first.Paul Sokolovsky
Otherwise, test may have artefacts in the presence of the micropython-lib module.
2018-06-27docs/usocket: getaddrinfo: Describe af/type/proto optional params.Paul Sokolovsky
These can be optionally specified, but all ports are expected to be able to accept them, at the very least ignore, though handling of "type" param (SOCK_STREAM vs SOCK_DGRAM) is recommended.
2018-06-27docs/ucryptolib: Add docs for new ucryptolib module.Paul Sokolovsky
2018-06-27unix/mpconfigport.h: Enable MICROPY_PY_UCRYPTOLIB.Paul Sokolovsky
2018-06-27tests/extmod/ucryptolib*: Add into and inplace tests for ucryptolib.Paul Sokolovsky
Tests for separate input and output buffer (alloc-free operation) and the same writable buffer used as input and output (inplace operation).
2018-06-27tests/extmod/ucryptolib*: Add tests for ucryptolib module.Paul Sokolovsky
2018-06-27extmod/moducryptolib: Add ucryptolib module with crypto functions.Paul Sokolovsky
The API follows guidelines of https://www.python.org/dev/peps/pep-0272/, but is optimized for code size, with the idea that full PEP 0272 compatibility can be added with a simple Python wrapper mode. The naming of the module follows (u)hashlib pattern. At the bare minimum, this module is expected to provide: * AES128, ECB (i.e. "null") mode, encrypt only Implementation in this commit is based on axTLS routines, and implements following: * AES 128 and 256 * ECB and CBC modes * encrypt and decrypt
2018-06-26docs/library: Add documentation for ucollections.deque.Damien George
2018-06-26stm32/mboot: Always use a flash latency of 1WS to match 48MHz HCLK.Damien George
2018-06-26stm32/mboot: Only compile in code for the USB periph that is being used.Damien George
Prior to this patch, if both USB FS and HS were enabled via the configuration file then code was included to handle both of their IRQs. But mboot only supports listening on a single USB peripheral, so this patch excludes the code for the USB that is not used.
2018-06-25stm32/mboot: Fix bug with invalid memory access of USB state.Damien George
Only one of pcd_fs_handle/pcd_hs_handle is ever initialised, so if both of these USB peripherals are enabled then one of these if-statements will access invalid memory pointed to by an uninitialised Instance. This patch fixes this bug by explicitly referencing the peripheral struct.
2018-06-25docs/esp8266: Fix minor typo in "certificates".jcea
2018-06-23stm32/modnetwork: Fix query of DNS IP address in ifconfig().Damien George
Thanks to @boochow for the fix.
2018-06-22py/compile: Combine expr, xor_expr and and_expr into one function.Damien George
This and the previous 4 commits combined have change in code size of: bare-arm: -92 minimal x86: -544 unix x64: -544 unix nanbox: -712 stm32: -116 cc3200: -128 esp8266: -348 esp32: -232
2018-06-22py/compile: Combine or_test and and_test compile functions.Damien George
2018-06-22py/compile: Combine global and nonlocal statement compile functions.Damien George
2018-06-22py/compile: Combine subscript_2 and subscript_3 into one function.Damien George
2018-06-22py/compile: Combine break and continue compile functions.Damien George
2018-06-22stm32/boards: Add .ld and af.csv files for STM32F722.Damien George
These files can also be used for F723, F732 and F733 MCUs.
2018-06-22tools/pydfu.py: Add support for multiple memory segments.Damien George
Segments are separated by / and begin with the memory address. This follows how the ST DFU tool works.
2018-06-22stm32/mboot: Add support for erase/read/write of external SPI flash.Damien George
This patch adds support to mboot for programming external SPI flash. It allows SPI flash to be programmed via a USB DFU utility in the same way that internal MCU flash is programmed.
2018-06-22stm32/qspi: Don't require data reads and writes to be a multiple of 4.Damien George
Prior to this patch the QSPI driver assumed that the length of all data reads and writes was a multiple of 4. This patch allows any length. Reads are optimised for speed by using 32-bit transfers when possible, but writes always use a byte transfer because they only use a single data IO line and are relatively slow.
2018-06-20py/stream: Remove stray empty line at start of file.Damien George
This was accidentally added in 6abede2ca9e221b6aefcaccbda0c89e367507df1
2018-06-20tests: Add tests using "file" argument in print and sys.print_exception.Damien George
2018-06-20py: Add checks for stream objects in print() and sys.print_exception().Damien George
2018-06-20py/stream: Update comment for mp_stream_write_adaptor.Damien George
2018-06-20stm32/boards/NUCLEO_F091RC: Fix TICK_INT_PRIORITY so it is highest prio.Damien George
Fixes issue #3880.
2018-06-19stm32/mboot: Define constants for reset mode cycling and timeout.Damien George
And fix timeout value so that it does actually finish with reset_mode=1.