aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-12-07py/malloc: MICROPY_MEM_STATS requires MICROPY_MALLOC_USES_ALLOCATED_SIZE.Paul Sokolovsky
Error out if they're set incompatibly.
2017-12-07py/mpprint: Fix "%x" vs "%X" regression introduced in previous commit.Paul Sokolovsky
2017-12-07py/mpprint: Support "%lx" format on 64-bit systems.Paul Sokolovsky
Before that, the output was truncated to 32 bits. Only "%x" format is handled, because a typical use is for addresses. This refactor actually decreased x86_64 code size by 30 bytes.
2017-12-07py/mpprint: Make "%p" format work properly on 64-bit systems.Paul Sokolovsky
Before, the output was truncated to 32 bits.
2017-12-06zephyr/CMakeLists.txt: Properly separate CFLAGS parts gotten from CMake.Paul Sokolovsky
Lack of spaces between them led to weird option artifacts like -Ifoo-Dbar.
2017-12-06zephyr/CMakeLists.txt: Update for latest Zephyr buildsys changes.Paul Sokolovsky
2017-12-06docs/glossary: Clarify wording for "baremetal".Paul Sokolovsky
2017-12-05py/modbuiltins: Use standard arg-parsing helper func for builtin print.Damien George
This allows the function to raise an exception when unknown keyword args are passed in. This patch also reduces code size by (in bytes): bare-arm: -24 minimal x86: -76 unix x64: -56 unix nanbox: -84 stm32: -40 esp8266: -68 cc3200: -48 Furthermore, this patch adds space (" ") to the set of ROM qstrs which means it doesn't need to be put in RAM if it's ever used.
2017-12-05tests/run-tests: Wrap long lists to facilitate adding more items.Paul Sokolovsky
2017-12-05py: mp_call_function_*_protected(): Pass-thru return value if possible.Paul Sokolovsky
Return the result of called function. If exception happened, return MP_OBJ_NULL. Allows to use mp_call_function_*_protected() with callbacks returning values, etc.
2017-12-04docs/library: Add xrefs to "stream" dictionary entry for many modules.Paul Sokolovsky
2017-12-04py/misc.h: Add m_new_obj_var_with_finaliser().Paul Sokolovsky
Similar to existing m_new_obj_with_finaliser().
2017-12-04docs/glossary: Describe string interning.Paul Sokolovsky
2017-12-04esp8266/modnetwork: Make sure to intern string passed to .config("param").Paul Sokolovsky
This is the proper fix for https://github.com/micropython/micropython/issues/3442.
2017-12-03docs/glossary: Describe "stream" term.Paul Sokolovsky
2017-12-03docs/uerrno: Fix xref-vs-code markup.Paul Sokolovsky
2017-12-03tests/cpydiff: Fix markup where "`" (xref) was used instead of "``" (code).Paul Sokolovsky
2017-12-03docs/glossary: Describe the callee-owned tuple concept.Paul Sokolovsky
2017-12-01zephyr/Makefile: syscall_macros.h generation was moved from CMake to make.Paul Sokolovsky
Required for #include <zephyr.h> to work.
2017-12-01stm32/boards/*_af.csv: Make consistent use of JTMS, JTCK, SWDIO, SWCLK.Damien George
5-pin JTAG and 2-pin SWD are logically separate interfaces so encode them in the AF tables as separate entries (separated by /, not -).
2017-12-01stm32/boards/stm32f767_af.csv: Update AF table based on datasheet.Damien George
Based on ST datasheet, DocID029041 Rev 3, DM00273119.pdf.
2017-11-30docs/uselect: ipoll: Fix grammar/wording of one-shot flag description.Paul Sokolovsky
2017-11-30docs/library/utime: Fix incorrect example with ticks_diff args order.Paul Carver
The parameter order in the example for ticks_diff was incorrect. If it's "too early" that means that scheduled time is greater than current time and if it's "running late" then scheduled time would be less than current time.
2017-11-30py/objgenerator: Remove unreachable code for STOP_ITERATION case.Damien George
This commit essentially reverts aa9dbb1b033a8163e07fcf5763fc20146354cc48 where this if-condition was added. It seems that even when that commit was made the code was never reached by any tests, nor reachable by analysis (see below). The same is true with the code as it currently stands: no test triggers this if-condition, nor any uasyncio examples. Analysing the flow of the program also shows that it's not reachable: ==START== -> to trigger this if condition mp_execute_bytecode() must return MP_VM_RETURN_YIELD with *sp==MP_OBJ_STOP_ITERATION -> mp_execute_bytecode() can only return MP_VM_RETURN_YIELD from the MP_BC_YIELD_VALUE bytecode, which can happen in 2 ways: -> 1) from a "yield <x>" in bytecode, but <x> must always be a proper object, never MP_OBJ_STOP_ITERATION; ==END1== -> 2) via yield from, via mp_resume() which must return MP_VM_RETURN_YIELD with ret_value==MP_OBJ_STOP_ITERATION, which can happen in 3 ways: -> 1) it delegates to mp_obj_gen_resume(); go back to ==START== -> 2) it returns MP_VM_RETURN_YIELD directly but with a guard that ret_val!=MP_OBJ_STOP_ITERATION; ==END2== -> 3) it returns MP_VM_RETURN_YIELD with ret_val set from mp_call_method_n_kw(), but mp_call_method_n_kw() must return a proper object, never MP_OBJ_STOP_ITERATION; ==END3== The above shows there is no way to trigger the if-condition and it can be removed.
2017-11-30esp8266/modules/webrepl_setup: Fix first-time enable of WebREPL.Damien George
Prior to this fix, enabling WebREPL for the first time via webrepl_setup did not work at all because "boot.py" did not contain any lines with "webrepl" in them that could be uncommented.
2017-11-29py/gc: In gc_realloc, convert pointer sanity checks to assertions.Damien George
These checks are assumed to be true in all cases where gc_realloc is called with a valid pointer, so no need to waste code space and time checking them in a non-debug build.
2017-11-29py/qstr: Rewrite find_qstr to make manifest that it returns a valid ptr.Damien George
So long as the input qstr identifier is valid (below the maximum number of qstrs) the function will always return a valid pointer. This patch eliminates the "return 0" dead-code.
2017-11-29py: Annotate func defs with NORETURN when their corresp decls have it.Damien George
2017-11-28zephyr/Makefile: Make prj_$(BOARD).conf optional, again.Paul Sokolovsky
This time hopefully should work reliably, using make $(wildcard) function, which in this case either expands to existing prj_$(BOARD).conf file, or to an empty string for non-existing one.
2017-11-28zephyr/Makefile: Convert to new CMake-based Zephyr build system.Paul Sokolovsky
Zephyr 1.10 switches to CMake-based build system (already in master).
2017-11-28zephyr/prj_base.conf: Force zephyr.bin build output.Paul Sokolovsky
As useful for CI systems. 1.10 doesn't build .bin for qemu_* for example. Also, remove deprecated CONFIG_LEGACY_KERNEL option.
2017-11-28tests/run-tests: "minimal": Skip recently added float/float_parse.py.Paul Sokolovsky
Fails for Zephyr qemu_x86 with: -9e-36 +9.000001e-36
2017-11-28zephyr/Makefile: clean: Remove generated prj_*_merged.conf.Paul Sokolovsky
2017-11-28tests/cpydiff: Add difference-test for second arg of builtin next().Damien George
2017-11-28tools/gen-cpydiff.py: Update executable paths to point to new ports dir.Damien George
2017-11-27py/objdict: Reuse dict-view key iterator for standard dict iterator.Damien George
It has equivalent behaviour and reusing it saves some code bytes.
2017-11-27tests/basics/builtin_locals: Add test for using locals() in class body.Damien George
2017-11-27py/parsenum: Improve parsing of floating point numbers.Damien George
This patch improves parsing of floating point numbers by converting all the digits (integer and fractional) together into a number 1 or greater, and then applying the correct power of 10 at the very end. In particular the multiple "multiply by 0.1" operations to build a fraction are now combined together and applied at the same time as the exponent, at the very end. This helps to retain precision during parsing of floats, and also includes a check that the number doesn't overflow during the parsing. One benefit is that a float will have the same value no matter where the decimal point is located, eg 1.23 == 123e-2.
2017-11-26docs/uselect: Describe POLLHUP/POLLERR semantics in more details.Paul Sokolovsky
Per POSIX, http://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html these flags aren't valid in the input eventmask. Instead, they can be returned in unsolicited manner in the output eventmask at any time.
2017-11-25docs/uctypes: Tweak descriptor reference to hopefully be easier to follow.Paul Sokolovsky
Put offset first in OR expressions, and use "offset" var instead of hardcoded numbers. Hopefully, this will make it more self-describing and show patterns better.
2017-11-25docs/uctypes: Typo/article fixes.Paul Sokolovsky
2017-11-24extmod/modlwip: Commit TCP out data to lower layers if buffer gets full.Damien George
Dramatically improves TCP sending throughput because without an explicit call to tcp_output() the data is only sent to the lower layers via the lwIP slow timer which (by default) ticks every 500ms.
2017-11-24extmod/modussl_axtls: Implement key and cert kw args to wrap_socket.Damien George
The key and cert must both be a str/bytes object in DER format.
2017-11-24tests/basics/builtin_range: Add test for corner case of range slicing.Damien George
2017-11-24tests/basics: Add test for containment of a subclass of a native type.Damien George
2017-11-24py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN.Damien George
Before this patch MP_BINARY_OP_IN had two meanings: coming from bytecode it meant that the args needed to be swapped, but coming from within the runtime meant that the args were already in the correct order. This lead to some confusion in the code and comments stating how args were reversed. It also lead to 2 bugs: 1) containment for a subclass of a native type didn't work; 2) the expression "{True} in True" would illegally succeed and return True. In both of these cases it was because the args to MP_BINARY_OP_IN ended up being reversed twice. To fix these things this patch introduces MP_BINARY_OP_CONTAINS which corresponds exactly to the __contains__ special method, and this is the operator that built-in types should implement. MP_BINARY_OP_IN is now only emitted by the compiler and is converted to MP_BINARY_OP_CONTAINS by swapping the arguments.
2017-11-24py/opmethods: Include the correct header for binary op enums.Damien George
By directly including runtime0.h the mpconfig.h settings are not included and so the enums in runtime0.h can be incorrect.
2017-11-24py/runtime: Simplify handling of containment binary operator.Damien George
In mp_binary_op, there is no need to explicitly check for type->getiter being non-null and raising an exception because this is handled exactly by mp_getiter(). So just call the latter unconditionally.
2017-11-23docs/uselect: poll: Explicitly specify that no-timeout value is -1.Paul Sokolovsky
2017-11-23docs: Add notes on heap allocation caused by bound method refs.Peter Hinch