Commit Graph

7495 Commits

Author SHA1 Message Date
Paul Sokolovsky
ddb56a0a84 README: Explicitly mention "await" support, and formatting for keywords. 2017-03-08 00:29:08 +01:00
Paul Sokolovsky
fd49ff9917 py/nlrx86: Add workaround for Zephyr.
Actually, this removes -fno-omit-frame-pointer workaround for Zephyr.
2017-03-07 16:48:09 +01:00
Paul Sokolovsky
830ce74f32 extmod/modutimeq: Make scheduling fair (round-robin).
By adding back monotonically increasing field in addition to time field.
As heapsort is not stable, without this, among entried added and readded
at the same time instant, some might be always selected, and some might
never be selected, leading to scheduling starvation.
2017-03-07 09:34:09 +01:00
Paul Sokolovsky
bdd48e67ee tests/uctypes_array_assign_native_le: Split off intbig part. 2017-03-07 08:40:03 +01:00
James Ouyang
e73a0b944f docs/esp8266/tutorial: Update since esptool 1.3 added Python 3 support.
esptool 1.3 now supports both Python 2.7 and 3.4+.
Updated github link to now-official espressif repo.
2017-03-07 18:23:24 +11:00
Rami Ali
2646b9e022 docs/library/lcd160cr: Add link to framebuf page. 2017-03-07 18:17:40 +11:00
Rami Ali
f9d18d96b7 docs/library: Add framebuf documentation. 2017-03-07 18:16:46 +11:00
Paul Sokolovsky
c98d7461a1 tests/micropython/: Split off intbig tests. 2017-03-07 07:12:58 +01:00
Krzysztof Blazewicz
1bd17de4b7 tests/basics/unpack1.py: Test if *a, = b copies b when b is a list. 2017-03-07 16:48:16 +11:00
Krzysztof Blazewicz
38c3778b27 tests/basics/string_join.py: Add test case where argument is not iterable. 2017-03-07 16:48:16 +11:00
Krzysztof Blazewicz
7e480e8a30 py: Use mp_obj_get_array where sequence may be a tuple or a list. 2017-03-07 16:48:16 +11:00
Krzysztof Blazewicz
1215dc47e2 py/runtime.c: Remove optimization of '*a,=b', it caused a bug.
*a, = b should always make a copy of b, instead, before this patch
if b was a list it would copy only a reference to it.
2017-03-07 16:48:16 +11:00
Paul Sokolovsky
88ffe0d5cc tests/string_format_modulo2: Split off intbig test. 2017-03-07 00:13:36 +01:00
Paul Sokolovsky
320099aab9 tools/tinytest-codegen: Update for recent test renaming ("intbig" suffix). 2017-03-06 22:40:04 +01:00
Paul Sokolovsky
4b03941f5e tests/float2int*: Suffix with _intbig, don't run on any other int type.
I.e. they don't run successfully with MICROPY_LONGINT_IMPL_NONE
and MICROPY_LONGINT_IMPL_LONGLONG (the problem is that they generate
different output than CPython, TODO to fix that).
2017-03-06 16:30:12 +01:00
Paul Sokolovsky
121fb88988 float/float2int*: Make actually be parsable for MICROPY_LONGINT_IMPL_NONE.
The use of large literal numbers is a big no-no when it comes to writing
programs which work with different int representations. Also, some checks
are pretty adhoc (e.g using struct module to check for 64-bitness). This
change bases entire detection on sys.maxsize and integer operarions, and
thus more correct, even if longer.

Note that this change doesn't mean that any of these tests can pass with
anything but MPZ - even despite checking for various int representations,
the tests aren't written to be portable among them.
2017-03-06 16:23:09 +01:00
Paul Sokolovsky
325c4473a5 tests/float/complex1: Split out intbig test. 2017-03-06 15:46:01 +01:00
Paul Sokolovsky
96aa3a3102 py/modsys: Use MP_SMALL_INT_MAX for sys.maxsize in case of LONGINT_IMPL_NONE.
INT_MAX used previosly is indeed max value for int, whereas on LP64
platforms, long is used for mp_int_t. Using MP_SMALL_INT_MAX is the
correct way to do it anyway.
2017-03-06 12:15:25 +01:00
Damien George
914648ce0e py/py.mk: Force nlr files to be compiled with -Os. 2017-03-06 17:13:43 +11:00
Damien George
f0dddb688d py/nlrx86: Convert from assembler to C file with inline asm. 2017-03-06 17:13:43 +11:00
Damien George
321848470c py/nlrx64: Convert from assembler to C file with inline asm. 2017-03-06 17:13:35 +11:00
Damien George
a85755aa22 py/nlrxtensa: Convert from assembler to C file with inline asm.
nlr_jump is a little bit inefficient because it now saves a register to
the stack.
2017-03-06 17:13:16 +11:00
Damien George
be3d7f91e5 py/nlr.h: Mark nlr_jump_fail as NORETURN. 2017-03-06 17:13:16 +11:00
Damien George
05fe66f68a py: Move locals/globals dicts to the thread-specific state.
Each threads needs to have its own private references to its current
locals/globals dicts, otherwise functions running within different
contexts (eg imported from different files) can behave very strangely.
2017-03-06 17:01:56 +11:00
Paul Sokolovsky
fe866d996f unix/moduselect: Properly implement ipoll object iteration.
TODO: There's another issue to care about: poll set being modified during
iteration.
2017-03-05 13:51:22 +01:00
Paul Sokolovsky
3ab6aa3a6d tests/basic: Split tests into working with small ints and not working.
Tests which don't work with small ints are suffixed with _intbig.py. Some
of these may still work with long long ints and need to be reclassified
later.
2017-03-04 00:13:27 +03:00
Paul Sokolovsky
89e570a5b4 tests/run-tests: Check for big int availability and skip related tests.
Big aka arbitrary-precision integers (implemented by MPZ module) are used
in tests starting with "int_big_" or ending with "_intbig".
2017-03-03 20:16:59 +03:00
Damien George
5e83a75c78 unix: Remove remaining, obsolete traces of GNU readline support. 2017-03-03 17:55:40 +11:00
Damien George
3d91c12d33 tests/basics: Add further tests for OrderedDict. 2017-03-03 11:23:54 +11:00
Damien George
9275c18270 py/map: Fix bugs with deletion of elements from OrderedDict.
There were 2 bugs, now fixed by this patch:
- after deleting an element the len of the dict did not decrease by 1
- after deleting an element searching through the dict could lead to
  a seg fault due to there being an MP_OBJ_SENTINEL in the ordered array
2017-03-03 11:21:19 +11:00
stijn
845a80a6c8 msvc: Add machine/pin-related sources to build
This fixes unresolved references after [f1ea3bc]
2017-03-02 09:54:03 +01:00
Damien George
e4be56a0ea qemu-arm: Enable machine module and associated tests. 2017-03-02 16:39:58 +11:00
Damien George
4f3c1b3fc1 stmhal/modnwcc3k: Add include for mp_hal_delay_ms. 2017-03-02 16:17:34 +11:00
Damien George
ecc635d551 tests/extmod: Add test for machine.Signal class. 2017-03-02 16:09:16 +11:00
Damien George
f1ea3bc72b unix/modmachine: Add Signal class to machine module. 2017-03-02 16:08:20 +11:00
Damien George
78185e6a6c stmhal/modpyb: Use utime ticks ms/us functions instead of custom ones. 2017-03-02 15:43:14 +11:00
Damien George
89738e8240 stmhal: Rename sys_tick ticks/delay functions to corresp. mp_hal ones.
The renames are:
HAL_Delay -> mp_hal_delay_ms
sys_tick_udelay -> mp_hal_delay_us
sys_tick_get_microseconds -> mp_hal_ticks_us

And mp_hal_ticks_ms is added to provide the full set of timing functions.

Also, a separate HAL_Delay function is added which differs slightly from
mp_hal_delay_ms and is intended for use only by the ST HAL functions.
2017-03-02 15:32:32 +11:00
Damien George
6ab5512132 stmhal: Use mp_hal_delay_ms instead of HAL_Delay. 2017-03-02 15:02:57 +11:00
Peter Hinch
1f549a3496 docs/library/lcd160cr: Add note about supported JPEG format/encodings. 2017-02-28 17:45:24 +11:00
Paul Sokolovsky
ed81574fe9 docs/machine: Fix formatting of Constants section.
Render related constants grouped together, with common description.
2017-02-28 00:38:15 +03:00
Damien George
528aeb3bf3 drivers/display/lcd160cr: Add check that JPEG size is less than 65536. 2017-02-27 18:39:35 +11:00
Damien George
f4a12dca58 py/objarray: Disallow slice-assignment to read-only memoryview.
Also comes with a test for this.  Fixes issue #2904.
2017-02-27 16:09:57 +11:00
Krzysztof Blazewicz
23ccb3e12e tools/gen-cpydiff.py: configurable CPython and micropython executables 2017-02-27 15:39:55 +11:00
Krzysztof Blazewicz
ae116c2430 docs/Makefile: define and use PYTHON as the interpreter for CPYDIFF
User can override PYTHON executable before running script,
gen-cpydiff.py works only with Python3 and most systems register
its executable as 'python3'.
2017-02-27 15:39:55 +11:00
Damien George
ad81a2e6cf minimal: Add ability and description to build without the compiler. 2017-02-27 15:09:15 +11:00
Damien George
3b2fd4df31 lib/utils/pyexec: Allow to compile when the uPy compiler is disabled. 2017-02-27 15:02:32 +11:00
Paul Sokolovsky
e2f1a8a7ee docs/uhashlib: Provide port-neutral description.
TODO: Remove WiPy-specific chunks.
2017-02-26 00:55:33 +03:00
Paul Sokolovsky
0982884655 extmod/modurandom: Use mp_raise_ValueError().
For the standard unix x86_64 build, this saves 11 bytes on object file
level, but no difference in executable size due to (bloaty) code alignment.
2017-02-24 10:04:23 -05:00
Paul Sokolovsky
4b3da60324 py/runtime: mp_raise_msg(): Accept NULL argument for message.
In this case, raise an exception without a message.

This would allow to shove few code bytes comparing to currently used
mp_raise_msg(..., "") pattern. (Actual savings depend on function code
alignment used by a particular platform.)
2017-02-24 09:57:25 -05:00
Damien George
6771adc75f esp8266/mpconfigport.h: Enable help('modules') feature. 2017-02-24 18:26:51 +11:00