Damien George
2750a7b38e
py/objdict: Actually provide the key that failed in KeyError exception.
...
The failed key is available as exc.args[0], as per CPython.
2016-10-17 12:00:19 +11:00
Damien George
a3edeb9ea5
py/objdict: Fix optimisation for allocating result in fromkeys.
...
Iterables don't respond to __len__, so call __len__ on the original
argument.
2016-10-17 11:58:57 +11:00
Damien George
e9404e5f5f
tests: Improve coverage of array, range, dict, slice, exc, unicode.
2016-10-17 11:43:47 +11:00
Damien George
453c2e8f55
tests/cmdline: Improve coverage test for printing bytecode.
2016-10-17 11:23:37 +11:00
Paul Sokolovsky
799ccdc789
esp8266, stmhal, unix: MAKE_FROZEN is consistently defined in mkenv.mk.
2016-10-16 10:49:36 +03:00
Paul Sokolovsky
06234a6115
extmod/modussl_mbedtls: Add dummy setblocking() method.
...
Accepts only value of True.
2016-10-15 23:46:13 +03:00
Scott Shawcroft
cb99ae5032
atmel-samd: Rename Feather M0 Bluefruit files to Feather M0 Basic because there isn't anything Bluefruit specific yet.
2016-10-14 13:10:17 -07:00
Scott Shawcroft
343ff4faed
atmel-samd: Make the Arduino Zero build use a bootloader.
2016-10-14 13:10:16 -07:00
Scott Shawcroft
c69ea1a143
py/makeversionhdr.py: Use any tag to describe the version.
2016-10-14 13:10:16 -07:00
Scott Shawcroft
8677f957fb
lib/utils: Clarify this is Adafruit's MicroPython derivative and help() isn't available yet.
2016-10-14 13:10:16 -07:00
Scott Shawcroft
005b4505f5
Rework the READMEs to clarify that this is a MicroPython derivative and
...
not MicroPython proper.
2016-10-14 12:25:55 -07:00
Paul Sokolovsky
36f97f19b4
extmod/utime_mphal: sleep_us/ms(): Don't wait on negative argument.
2016-10-14 22:19:45 +03:00
Paul Sokolovsky
f059563507
stmhal/modutime: Refactor to use extmod/utime_mphal.c.
...
This includes making sure that utime_mphal's sleep_ms() and sleep_us()
don't sleep on negative arguments.
2016-10-14 20:42:42 +03:00
Scott Shawcroft
0584ba1218
Merge pull request #10 from adafruit/frozen_modules
...
atmel-samd: Add modules directory with frozen bytecode support (like ESP8266 port), and NeoPixel python wrapper module.
2016-10-14 10:16:16 -07:00
Paul Sokolovsky
a97284423e
extmod/utime_mphal: Factor out implementations in terms of mp_hal_* for reuse.
...
As long as a port implement mp_hal_sleep_ms(), mp_hal_ticks_ms(), etc.
functions, it can just use standard implementations of utime.sleel_ms(),
utime.ticks_ms(), etc. Python-level functions.
2016-10-14 20:14:01 +03:00
Tony DiCola
fffc6d1a17
atmel-samd: Add modules directory with frozen bytecode support (like ESP8266 port), and NeoPixel python wrapper module.
2016-10-14 11:39:42 +00:00
Damien George
824f5c5a32
py/vstr: Combine vstr_new_size with vstr_new since they are rarely used.
...
Now there is just one function to allocate a new vstr, namely vstr_new
(in addition to vstr_init etc). The caller of this function should know
what initial size to allocate for the buffer, or at least have some policy
or config option, instead of leaving it to a default (as it was before).
2016-10-14 16:46:34 +11:00
Scott Shawcroft
674038c281
Correct code of conduct link.
2016-10-13 14:11:53 -07:00
Scott Shawcroft
8d9da429c2
Add code of conduct so that expectations on contributor behavior are
...
clearly laid out and a process for reporting violations is in place.
2016-10-13 14:09:39 -07:00
Scott Shawcroft
d451f690ef
Merge pull request #9 from adafruit/ticks_ms
...
Support ticks in os.
2016-10-13 12:22:31 -07:00
Tony DiCola
2ee52c4fde
atmel-samd: Minor fixes to SysTick handler, enable all interrupts function.
2016-10-13 18:36:00 +00:00
Damien George
ed878275b0
esp8266: Enable micropython.alloc_emergency_exception_buf().
2016-10-14 01:27:53 +11:00
Damien George
34d0b3f85c
tests/micropython: Add tests for heap_lock, and emergency exceptions.
2016-10-14 00:32:34 +11:00
Damien George
6a4c6fc023
qemu-arm: Remove SRC_TEST_C from SRC_QSTR list, it's not needed.
...
And it gives problems with header dependencies for auto-qstr generation.
2016-10-14 00:30:38 +11:00
Damien George
b0a15aa735
qemu-arm: Enable lots of extmods and enable tests for them.
...
The qemu-arm port is used for testing of ARM Thumb architecture on a
desktop so should have many features enabled.
2016-10-14 00:08:19 +11:00
Damien George
8298251215
stmhal/pybstdio: Use size_t instead of mp_uint_t.
2016-10-14 00:07:32 +11:00
Alex March
e42186d356
tests/extmod/vfs_fat: Replace asserts with prints and expected outputs.
2016-10-13 14:56:47 +03:00
Tony DiCola
f77113c04f
atmel-samd: Add time.ticks_diff function from esp port.
2016-10-13 05:18:18 +00:00
Tony DiCola
903bc8d04e
atmel-samd: Implement time.ticks_ms function using SysTick timer, add global interrupt enable/disable functions.
2016-10-13 04:59:43 +00:00
Damien George
f2f8ae110b
extmod/modujson: Fix nanbox build.
2016-10-13 12:09:18 +11:00
Damien George
11ab807d76
tests/extmod: Add test for ujson.load().
2016-10-13 11:46:49 +11:00
Damien George
e93c1ca5da
extmod/modujson: Implement ujson.load() to load JSON from a stream.
...
This refactors ujson.loads(s) to behave as ujson.load(StringIO(s)).
Increase in code size is: 366 bytes for unix x86-64, 180 bytes for
stmhal, 84 bytes for esp8266.
2016-10-13 11:46:14 +11:00
Paul Sokolovsky
f17f3314d0
zephyr: Add copyright blurbs.
2016-10-12 22:51:17 +03:00
Paul Sokolovsky
1a01ed0d2a
zephyr/mpconfigport.h: Fix rebasing artifacts.
2016-10-12 19:42:55 +03:00
Daniel Thompson
b6a544b917
zephyr: Implement the help() function.
...
The boot issue text mentions a help() function and encourages
the user to run it. It is very disconcerting to find that the
function does not exist...
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-10-12 19:31:39 +03:00
Paul Sokolovsky
06ee5e947f
zephyr/Makefile: Be sure to extra qstr's from port sources.
2016-10-12 19:15:32 +03:00
Paul Sokolovsky
998578a2b8
README: Mention _thread module availability in select ports.
2016-10-12 19:12:20 +03:00
Paul Sokolovsky
cdbeee0c50
tools: Upgrade upip to 1.1.3.
...
Initial support for running on a baremetal, low-heap systems (like esp8266),
using Python module interface.
2016-10-12 18:55:31 +03:00
Paul Sokolovsky
4021b1e1b8
lib/utils/pyexec: Don't treat SystemExit as "forced exit".
...
"Forced exit" is treated as soft-reboot (Ctrl+D). But expected effect of
calling sys.exit() is termination of the current script, not any further
and more serious actions like mentioned soft reboot.
2016-10-12 18:00:32 +03:00
Damien George
af8d791bd0
esp8266: Enable importing of precompiled .mpy files.
2016-10-12 11:03:58 +11:00
Damien George
11fc6553e8
esp8266: Enable sys.{stdin,stdout,stderr}.buffer for raw serial access.
2016-10-12 11:03:58 +11:00
Damien George
31101d91ce
py/lexer: Remove unnecessary code, and unreachable code.
...
Setting emit_dent=0 is unnecessary because arriving in that part of the
if-logic will guarantee that emit_dent is already zero.
The block to check indent_top(lex)>0 is unreachable because a newline is
always inserted an the end of the input stream, and hence dedents are
always processed before EOF.
2016-10-12 11:00:17 +11:00
Damien George
deaa57acf3
py/compile: Remove debugging code for compiler dispatch.
...
It was a relic from the days of developing the compiler and is no longer
needed, and it's impossible to trigger via a test.
2016-10-12 10:20:48 +11:00
Scott Shawcroft
011056af15
atmel-samd: Add support for SPI.
...
Also separate out the ASF config headers that are shared across all boards.
2016-10-11 15:48:43 -07:00
Radomir Dopieralski
db4e009217
esp8266/mpconfigport: Enable MICROPY_PY_BUILTINS_SLICE_ATTRS
2016-10-11 12:22:36 +02:00
Alex March
f274561e16
tests/extmod/vfs_fat: Test coverage for remove() and rmdir().
2016-10-11 16:03:52 +11:00
Alex March
d02f3a57f4
extmod/vfs_fat: Add file and directory checks for remove and rmdir.
2016-10-11 16:03:52 +11:00
Radomir Dopieralski
eaef6b5324
extmod/machine_i2c: Use writes not reads in i2c.scan().
...
As per discussion in #2449 , using write requests instead of read requests
for I2C.scan() seems to support a larger number of devices, especially
ones that are write-only. Even a read-only I2C device has to implement
writes in order to be able to receive the address of the register to read.
2016-10-11 15:30:46 +11:00
Peter Hinch
9e1dec1818
docs/reference: Add constrained.rst doc.
...
It contains detailed information about writing scripts to run efficiently
on microcontrollers (and other constrained systems).
2016-10-11 15:27:20 +11:00
Paul Sokolovsky
39968aaaff
extmod/uzlib: Update to upstream v2.1.
...
Adds check that LZ offsets fall into the sliding dictionary used. This
catches a case when uzlib.DecompIO with a smaller dictionary is used
to decompress data which was compressed with a larger dictionary.
Previously, this would lead to producing invalid data or crash, now
an exception will be thrown.
2016-10-11 07:13:23 +03:00