aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2017-10-10py/modmath: Add full checks for math domain errors.Damien George
This patch changes how most of the plain math functions are implemented: there are now two generic math wrapper functions that take a pointer to a math function (like sin, cos) and perform the necessary conversion to and from MicroPython types. This helps to reduce code size. The generic functions can also check for math domain errors in a generic way, by testing if the result is NaN or infinity combined with finite inputs. The result is that, with this patch, all math functions now have full domain error checking (even gamma and lgamma) and code size has decreased for most ports. Code size changes in bytes for those with the math module are: unix x64: -432 unix nanbox: -792 stm32: -88 esp8266: +12 Tests are also added to check domain errors are handled correctly.
2017-10-10docs/esp8266/quickref: Add quickref info for RTC class.Mike Causer
2017-10-10docs/pyboard/tutorial: Update now that yellow LED also supports PWM.Mike Causer
2017-10-10docs/pyboard/quickref: Add info for Switch, RTC, CAN, Accel classes.Mike Causer
2017-10-10py/bc: Update opcode_format_table to match the bytecode.Damien George
2017-10-09docs/library/network: Clarify usage of "bssid" arg in connect() method.Damien George
2017-10-09esp8266/modnetwork: Add "bssid" keyword arg to WLAN.connect() method.Damien George
2017-10-09examples: hwconfig_console: Add .on()/.off() methods.Paul Sokolovsky
Add these methods to this "GPIO output emulated with console prints" config.
2017-10-08tools/pyboard: Update docstring for additional device support.Paul Sokolovsky
2017-10-07zephyr: Switch to interrupt-driven pull-style console.Paul Sokolovsky
While this console API improves handling on real hardware boards (e.g. clipboard paste is much more reliable, as well as programmatic communication), it vice-versa poses problems under QEMU, apparently because it doesn't emulate UART interrupt handling faithfully. That leads to inability to run the testsuite on QEMU at all. To work that around, we have to suuport both old and new console routines, and use the old ones under QEMU.
2017-10-07tests/run-tests: Close device under test using "finally".Paul Sokolovsky
We want to close communication object even if there were exceptions somewhere in the code. This is important for --device exec:/execpty: which may otherwise leave processing running in the background.
2017-10-07zephyr: Use CONFIG_NET_APP_SETTINGS to setup initial network addresses.Paul Sokolovsky
Ideally, these should be configurable from Python (using network module), but as that doesn't exist, we better off using Zephyr's native bootstrap configuration facility.
2017-10-06stm32/boards: Fix typos in stm32f767_af.csv table.Damien George
2017-10-06drivers/display/ssd1306: Make poweron() work the same with SSD1306_SPI.Damien George
The poweroff() and poweron() methods are used to do soft power control of the display, and this patch makes these methods work the same for both I2C and SPI interfaces.
2017-10-06drivers/display/ssd1306: Implement SSD1306_I2C poweron method.Tiago Queiroz
After a poweroff(), the poweron() method does a soft power-on and any previous state of the display persists.
2017-10-05tools/pyboard: Use repr() when quoting data in error messages.Paul Sokolovsky
As it may contain newlines, etc.
2017-10-05tests/extmod: Add test for '-' in character class in regex.Damien George
2017-10-05stm32/modnwwiznet5k: Get the IP address of an established socket.Li Weiwei
When wiznet5k_socket_accept is called, if a socket is established, get the IP address of the socket.
2017-10-05py/persistentcode: Bump .mpy version number to version 3.Damien George
The binary and unary ops have changed bytecode encoding.
2017-10-05py/objtype: Clean up unary- and binary-op enum-to-qstr mapping tables.Damien George
2017-10-05py: Clean up unary and binary enum list to keep groups together.Damien George
2 non-bytecode binary ops (NOT_IN and IN_NOT) are moved out of the bytecode group, so this change will change the bytecode format.
2017-10-04lib/libm: Fix tanhf so that it correctly handles +/- infinity args.Damien George
2017-10-04py/mpprint: Only check for null string printing when NDEBUG not defined.Damien George
Printing "(null)" when a NULL string pointer is passed to %s is a debugging feature and not a feature that's relied upon by the code. So it only needs to be compiled in when debugging (such as assert) is enabled, and saves roughy 30 bytes of code when disabled. This patch also fixes this NULL check to not do the check if the precision is specified as zero.
2017-10-04py/objstr: Make empty bytes object have a null-terminating byte.Damien George
Because a lot of string processing functions assume there is a null terminating byte, so they can work in an efficient way. Fixes issue #3334.
2017-10-04all: Remove inclusion of internal py header files.Damien George
Header files that are considered internal to the py core and should not normally be included directly are: py/nlr.h - internal nlr configuration and declarations py/bc0.h - contains bytecode macro definitions py/runtime0.h - contains basic runtime enums Instead, the top-level header files to include are one of: py/obj.h - includes runtime0.h and defines everything to use the mp_obj_t type py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h, and defines everything to use the general runtime support functions Additional, specific headers (eg py/objlist.h) can be included if needed.
2017-10-04py/objtype: Change type of enum-to-qstr table to uint16_t to save space.Damien George
Qstr values fit in 16-bits (and this fact is used elsewhere in the code) so no need to use more than that for the large lookup tables. The compiler will anyway give a warning if the qstr values don't fit in 16 bits. Saves around 80 bytes of code space for Thumb2 archs.
2017-10-04docs/esp8266/tutorial: Update neopixel with example of using 4 bbp.Gabe
2017-10-04py/{mkenv.mk,mkrules.mk}: Append .exe for Windows executable files.chrismas9
Building mpy-cross: this patch adds .exe to the PROG name when building executables for host (eg mpy-cross) on Windows. make clean now removes mpy-cross.exe under Windows. Building MicroPython: this patch sets MPY_CROSS to mpy-cross.exe or mpy-cross so they can coexist and use cygwin or WSL without rebuilding mpy-cross. The dependency in the mpy rule now uses mpy-cross.exe for Windows and mpy-cross for Linux.
2017-10-03esp8266/esp_mphal: Send data in chunks to mp_uos_dupterm_tx_strn.Damien George
Sending byte-by-byte is inefficient and leads to errors in the WebSocket protocol when sending utf-8 encoded characters.
2017-10-03drivers/nrf24l01: Make nRF24L01 test script more portable.Damien George
2017-10-03py/objset: Include the failed key in a KeyError raised from set.remove.Damien George
2017-10-03py/objset: Check that RHS of a binary op is a set/frozenset.Damien George
CPython docs explicitly state that the RHS of a set/frozenset binary op must be a set to prevent user errors. It also preserves commutativity of the ops, eg: "abc" & set() is a TypeError, and so should be set() & "abc". This change actually decreases unix (x64) code by 160 bytes; it increases stm32 by 4 bytes and esp8266 by 28 bytes (but previous patch already introduced a much large saving).
2017-10-03py/objset: Simplify set and frozenset by separating their locals dicts.Damien George
A lot of set's methods (the mutable ones) are not allowed to operate on a frozenset, and giving frozenset a separate locals dict with only the methods that it supports allows to simplify the logic that verifies if args are a set or a frozenset. Even though the new frozenset locals dict is relatively large (88 bytes on 32-bit archs) there is a much bigger saving coming from the removal of a const string for an error message, along with the removal of some checks for set or frozenset type. Changes in code size due to this patch are (for ports that changed at all): unix x64: -56 unix nanbox: -304 stm32: -64 esp8266: -124 cc3200: -40 Apart from the reduced code, frozenset now has better tab-completion because it only lists the valid methods. And the error message for accessing an invalid method is now more detailed (it includes the method name that wasn't found).
2017-10-03tests/extmod: Add test for ure regexes leading to infinite recursion.Paul Sokolovsky
These now should be caught properly and lead to RuntimeError instead of crash.
2017-10-03extmod/modure: Add stack overflow checking when executing a regex.Paul Sokolovsky
2017-10-02extmod/re1.5: Upgrade to v0.8.2, adds hook for stack overflow checking.Paul Sokolovsky