summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-29extmod/moduselect: Refactor towards introduction of poll.ipoll().Paul Sokolovsky
This follows previous refactor made to unix/moduselect.
2017-04-29extmod/moduselect: Convert to MP_ROM_QSTR and friends.Paul Sokolovsky
2017-04-28qemu-arm, stmhal: Remove dummy memory.h since it's no longer needed.Damien George
extmod/crypto-algorithms/sha256.c was recently fixed so that it didn't include this header.
2017-04-27examples/hwapi: Add config for Zephyr port of 96Boards Carbon.Paul Sokolovsky
2017-04-27extmod/crypto-algorithms/sha256: Remove non-standard memory.h header.Paul Sokolovsky
2017-04-27zephyr/modusocket: Add dummy makefile() implementation.Paul Sokolovsky
2017-04-26zephyr/modusocket: sock_read: Check socket status only at the start of packet.Paul Sokolovsky
Otherwise, if we already have a packet in progress, finish it first, before check "peer closed" status.
2017-04-26zephyr/modusocket: Add read/readline/readinto stream methods.Paul Sokolovsky
2017-04-26zephyr/modusocket: Refactor recv() into stream read() method.Paul Sokolovsky
2017-04-26unix: Remove obsolete MICROPY_FATFS macro.Damien George
It doesn't do anything. The VFS feature is controlled by MICROPY_VFS and the FatFS driver, by MICROPY_VFS_FAT (which are set in mpconfigport.h).
2017-04-26zephyr/modusocket: Enable stream write() method.Paul Sokolovsky
2017-04-26zephyr/modusocket: Refactor send() into stream write() method.Paul Sokolovsky
2017-04-26zephyr: Add 96b_carbon configuration.Kushal Das
As there's no networking support in mainline yet, networking is disabled, because otherwise the board hangs on startup.
2017-04-25py/mpz: In mpn_sub, use existing function to remove trailing zeros.Damien George
2017-04-25tests/basics: Add tests for int.from_bytes when src has trailing zeros.Damien George
The trailing zeros should be truncated from the converted value.
2017-04-25py/mpz: Strip trailing zeros from mpz value when set from bytes.Damien George
2017-04-22zephyr/main: Configure IPv4 netmask and gateway to allow Internet access.Paul Sokolovsky
2017-04-22tests: Add tests for calling super and loading a method directly.Damien George
2017-04-22py: Add LOAD_SUPER_METHOD bytecode to allow heap-free super meth calls.Damien George
This patch allows the following code to run without allocating on the heap: super().foo(...) Before this patch such a call would allocate a super object on the heap and then load the foo method and call it right away. The super object is only needed to perform the lookup of the method and not needed after that. This patch makes an optimisation to allocate the super object on the C stack and discard it right after use. Changes in code size due to this patch are: bare-arm: +128 minimal: +232 unix x64: +416 unix nanbox: +364 stmhal: +184 esp8266: +340 cc3200: +128
2017-04-22py/compile: Refactor handling of special super() call.Damien George
This patch refactors the handling of the special super() call within the compiler. It removes the need for a global (to the compiler) state variable which keeps track of whether the subject of an expression is super. The handling of super() is now done entirely within one function, which makes the compiler a bit cleaner and allows to easily add more optimisations to super calls. Changes to the code size are: bare-arm: +12 minimal: +0 unix x64: +48 unix nanbox: -16 stmhal: +4 cc3200: +0 esp8266: -56
2017-04-22py/compile: Don't do unnecessary check if iter parse node is a struct.Damien George
If we get to this point in the code then pn_iter is guaranteed to be a struct.
2017-04-22mpy-cross, unix, windows, stmhal: Enable return-if-else optimisation.Damien George
Prior to making this a config option it was previously available on these (and all other) ports, and it makes sense to keep it enabled for mpy-cross as well as ports that have a decent amount of space for the code.
2017-04-22py/compile: Add COMP_RETURN_IF_EXPR option to enable return-if-else opt.Damien George
With this optimisation enabled the compiler optimises the if-else expression within a return statement. The optimisation reduces bytecode size by 2 bytes for each use of such a return-if-else statement. Since such a statement is not often used, and costs bytes for the code, the feature is disabled by default. For example the following code: def f(x): return 1 if x else 2 compiles to this bytecode with the optimisation disabled (left column is bytecode offset in bytes): 00 LOAD_FAST 0 01 POP_JUMP_IF_FALSE 8 04 LOAD_CONST_SMALL_INT 1 05 JUMP 9 08 LOAD_CONST_SMALL_INT 2 09 RETURN_VALUE and to this bytecode with the optimisation enabled: 00 LOAD_FAST 0 01 POP_JUMP_IF_FALSE 6 04 LOAD_CONST_SMALL_INT 1 05 RETURN_VALUE 06 LOAD_CONST_SMALL_INT 2 07 RETURN_VALUE So the JUMP to RETURN_VALUE is optimised and replaced by RETURN_VALUE, saving 2 bytes and making the code a bit faster.
2017-04-22py/compile: Extract parse-node kind at start of func for efficiency.Damien George
Otherwise the type of parse-node and its kind has to be re-extracted multiple times. This optimisation reduces code size by a bit (16 bytes on bare-arm).
2017-04-22py/compile: Don't do unnecessary check if parse node is a struct.Damien George
PN_atom_expr_normal parse nodes always have structs for their second sub-node, so simplify the check for the sub-node kind to save code size.
2017-04-22py/objtype: mp_obj_new_super doesn't need to be public, so inline it.Damien George
Saves code size (20 bytes on bare-arm) and makes it a tiny bit more efficient.
2017-04-21extmod/moductypes: Fix bigint handling for 32-bit ports.Paul Sokolovsky
2017-04-21windows: Bring mpconfigport.h up-to-date with unix portstijn
Add definitions/source files for features which work on the windows ports but weren't yet enabled. UTIME related lines are moved a couple of lines up to make comparision with unix/mpconfigport.h easier in the future.
2017-04-21py: Reduce str/repr precision of float numbers when floats are 30-bit.Damien George
With 30-bit floats there aren't enough bits to faithfully print 7 decimal digits, so reduce the precision to 6 digits.
2017-04-19zephyr/modmachine: Implement machine.reset().Paul Sokolovsky
2017-04-18stmhal/timer: Clear interrupt flag before setting callback.Henrik Sölver
Sometimes when setting a channel callback the callback fires immediately, even if the compare register is set to a value far into the future. This happens when the free running counter has previously been equal to what happens to be in the compare register. This patch make sure that there is no pending interrupt when setting a callback.
2017-04-18tests/micropython: Add test for micropython.kbd_intr().Damien George
2017-04-18py/modmicropython: Add micropython.kbd_intr() function.Damien George
It controls the character that's used to (asynchronously) raise a KeyboardInterrupt exception. Passing "-1" allows to disable the interception of the interrupt character (as long as a port allows such a behaviour).
2017-04-18docs/library/machine.SPI: Fix formatting of bullet list to stop warning.Damien George
2017-04-18docs/library/machine.I2C: Remove WiPy-specific return values.Damien George
cc3200 has been updated to conform to the API and now returns None.
2017-04-18cc3200/mods/pybi2c: Make readfnom_mem_into/writeto_mem return None.Damien George
This aligns the I2C class to match the standard machine.I2C API. Note that this is a (small) breaking change to the existing cc3200 API. The original API just returned the size of the input buffer so there's no information lost by this change. To update scripts users should just use the size of the buffer passed to these functions to get the number of bytes that are read/written.
2017-04-18docs/esp8266/quickref: Add links from quickref page to machine classes.Damien George
2017-04-18docs/library/machine.*: Add cross-reference label to individual classes.Damien George
2017-04-18docs/library/machine.I2C: Deconditionalise all methods.Damien George
The cc3200 port is now similar enough to the standard machine.I2C API so that all conditionals can be removed.
2017-04-18docs/wipy/general: Add section about specifics of I2C implementation.Damien George
2017-04-18docs/wipy/quickref: Update reference for change to I2C API.Damien George
2017-04-18cc3200/mods/pybi2c: Make machine.I2C constructor/init conform to HW API.Damien George
This is a user-facing change to the cc3200's API, to make it conform to the new machine hardware API. The changes are: - change I2C constructor to: I2C(id=0, *, freq=100000, scl=None, sda=None) - change I2C init to: init(*, freq, scl, sda) - removal of machine.I2C.MASTER constant - I2C str/repr no longer prints I2C.MASTER To update existing code it should be enough to just remove the I2C.MASTER constant from contructor/init for I2C.
2017-04-18docs/library/machine.UART: Remove pyboard-specific section.Damien George
stmhal doesn't have a machine.UART class so this section is not needed.
2017-04-18minimal/main: Make Cortex-M vector table constant.Damien George
2017-04-16tests/run-tests: Don't post-process CRASH result in any way.Paul Sokolovsky
If we got a CRASH result, return early, similar to SKIP. This is important because previous refactor changed branching logic a bit, so CRASH now gets post-processed into CRASH\n, which broke remote hardware tests.
2017-04-16docs/library/machine: Typo fix in machine_callbacks section.Paul Sokolovsky
2017-04-16docs/machine: Move machine.main() misnomer to wipy's known issues.Paul Sokolovsky
2017-04-16docs/machine.UART: Deconditionalize normal methods.Paul Sokolovsky
2017-04-16docs/library/ussl: Deconditionalize, wipy notes moved to its documentation.Paul Sokolovsky
2017-04-16docs/library/uos: urandom: Generalize description.Paul Sokolovsky
Don't give a guarantee of HW RNG, only a possibility of its usage.