Commit Graph

7436 Commits

Author SHA1 Message Date
Damien George
681994638b py/objgenerator: When throwing an object, don't make an exc instance.
Arguments to throw() for generators don't need to be exceptions.
2017-01-17 00:14:14 +11:00
Damien George
aeb2655073 py/runtime: Fix handling of throw() when resuming generator.
If GeneratorExit is injected as a throw-value then that should lead to
the close() method being called, if it exists.  If close() does not exist
then throw() should not be called, and this patch fixes this.
2017-01-17 00:10:49 +11:00
Damien George
40863fce6f py/runtime: Refactor assert(0) to improve coverage. 2017-01-17 00:09:56 +11:00
Rami Ali
751e379533 tests: Improve frozen import test coverage. 2017-01-16 16:59:03 +11:00
Damien George
d23834bc96 py/builtinimport: Remove unreachable code and change obj-import comment. 2017-01-16 16:41:43 +11:00
Damien George
63e291de70 py/builtinimport: Raise ValueError for bad relative import, per CPython. 2017-01-16 16:21:04 +11:00
Damien George
9317fee523 unix/coverage: Move coverage #if guard back to top of file. 2017-01-16 16:20:49 +11:00
Rami Ali
50e14ca619 tests/import: Improve builtinimport.c test coverage. 2017-01-16 15:59:33 +11:00
Rami Ali
8d01bd3a1c tests: Improve stream.c test coverage. 2017-01-16 15:57:10 +11:00
Pavol Rusnak
b82fc8dcef
stmhal: fix wrong usage of gcc -print-libgcc-file-name 2017-01-12 20:32:43 +01:00
Dave Hylands
aa53496391 stmhal: Support PortG on STM32L476 and STM32L486. 2017-01-12 17:27:28 +11:00
Oleg Korsak
e45035db5c extmod/modframebuf: optimize fill_rect subroutine call 2017-01-08 20:16:17 +02:00
Damien George
65cadbeb9d tests: Update test suite to be compatible with CPython 3.6.
CPython 3.6 has a few changes that, when run on uPy's test suite, give a
different output to CPython 3.5.  uPy currently officially supports the
3.4 language definition, but it's useful to be able to run the test suite
with 3.4/3.5/3.6 versions of CPython.  This patch makes such changes to
support 3.6.
2017-01-09 00:19:01 +11:00
Damien George
5653e3c72f docs: Bump version to 1.8.7. 2017-01-08 23:53:08 +11:00
Damien George
a722ed532f tests/unix/extra_coverage: Add tests for importing frozen packages. 2017-01-08 22:45:55 +11:00
Damien George
b528e9a428 py/builtinimport: Fix bug when importing names from frozen packages.
The commit d9047d3c8a introduced a bug
whereby "from a.b import c" stopped working for frozen packages.  This is
because the path was not properly truncated and became "a//b".  Such a
path resolves correctly for a "real" filesystem, but not for a search in
the list of frozen modules.
2017-01-08 20:17:23 +11:00
syndycat
b2611d6be3 drivers/onewire/ds18x20: Fix negative temperature calc for DS18B20. 2017-01-08 19:26:22 +11:00
Paul Sokolovsky
044f96c330 cc3200/modwlan: Add network.WLAN.print_ver() diagnostic function.
Prints NWP/MAC/PHY version, as affected by servicepack installed.
2017-01-07 19:48:12 +03:00
Paul Sokolovsky
a1a8f01799 docs/usocket: Clarify that socket timeout raises OSError exception. 2017-01-07 14:23:33 +03:00
Paul Sokolovsky
ef1bbada96 tests/array*: Allow to skip test if "array" is unavailable. 2017-01-07 01:13:40 +03:00
Paul Sokolovsky
e5a6a26330 tests/types1: Split out set type test to set_types.
set isn't the most basic type and can be disabled by a port.
2017-01-06 11:01:55 +03:00
Damien George
36ec5c8f27 docs/library/esp: Remove para and add further warning about flash.
There is no longer space reserved by default for native code.
2017-01-06 18:32:49 +11:00
Damien George
e343bea6e7 esp8266/modules/flashbdev: Change RESERVED_SECS to 0.
This effectively reverts the change that introduced this new constant.
The reason is so that users do not need to rebuild the filesystem on
their modules when upgrading the firmware.

Users can change RESERVED_SECS by hand if they need the feature, and in
future firmware it may default to a non-zero value.
2017-01-06 18:30:55 +11:00
Damien George
cc7e48fdc8 esp8266/modules/flashbdev: Remove now-unused function set_bl_flash_size. 2017-01-06 16:22:53 +11:00
Paul Sokolovsky
4a72294d7d esp8266/modules/flashbdev: Remove code to patch bootloader flash size.
This code is no longer pertinent for some time - since switchover to
SDK2.0, there must be correct flash size set for bootloader, or there's
a risk of flash data corruption. And indeed, the correct flash size is
by default auto-detected by esptool.py 1.2.
2017-01-05 22:26:23 +03:00
Damien George
5d0d61586c unix/Makefile: Allow cache-map-lookup optimisation with frozen bytecode. 2017-01-05 15:55:06 +11:00
Damien George
98458a46ec tools/mpy-tool.py: Add support for OPT_CACHE_MAP_LOOKUP_IN_BYTECODE.
With caching of map lookups in the bytecode, frozen bytecode can still
work but must be stored in RAM, not ROM.  This patch allows mpy-tool.py to
generate code that works with this optimisation, but it's not recommended
to use it on embedded targets (because of lack of RAM).
2017-01-05 15:52:52 +11:00
Damien George
343b4189b0 py/mkrules.mk: Add MPY_CROSS_FLAGS option to pass flags to mpy-cross.
So that ports can pass their own custom options to mpy-cross.
2017-01-05 15:51:36 +11:00
Damien George
8d1c236a1f tests/unix/extra_coverage: Add basic tests to import frozen str and mpy. 2017-01-05 14:58:08 +11:00
Damien George
1551309575 unix: Enable and add basic frozen str and frozen mpy in coverage build. 2017-01-05 14:55:57 +11:00
Damien George
ea00151ffa unix/Makefile: Split long line for coverage target, easier to modify. 2017-01-05 14:48:48 +11:00
Rami Ali
d7e168428b tests/unix: Improve formatfloat.c test coverage using C. 2017-01-05 12:31:05 +11:00
Rami Ali
64dc925c4a tests/float: Improve formatfloat.c test coverage using Python. 2017-01-05 12:31:05 +11:00
Rami Ali
ec72db8a39 tests: Improve warning.c test coverage. 2017-01-05 12:23:40 +11:00
Paul Sokolovsky
26f00ff154 tests/run-tests: Allow to skip set tests.
If sets are not enabled, set literals lead to SyntaxError during parsing,
so it requires feature_check. Set tests are skipped based on set_*.py
pattern.
2017-01-05 00:16:29 +03:00
Paul Sokolovsky
eac22e29a5 all: Consistently update signatures of .make_new and .call methods.
Otherwise, they serve reoccurring source of copy-paste mistakes and
breaking nanbox build.
2017-01-04 16:10:42 +03:00
Damien George
c3f70c603e docs/library/esp: Document esp.set_native_code_location() function. 2017-01-04 23:48:19 +11:00
Damien George
bae7798f1e esp8266/modules/flashbdev: Add RESERVED_SECS before the filesystem.
Starting at esp.flash_user_start(), the reserved sectors are for general
purpose use, for example for native code generation.  There is currently
one sector reserved as such.
2017-01-04 23:47:09 +11:00
Paul Sokolovsky
b0f23786da esp8266/Makefile: Put firmware-ota.bin in build/, for consistency. 2017-01-04 10:36:28 +03:00
Paul Sokolovsky
52c19875a4 esp8266/general: Add "Scarcity of runtime resources" section.
With warnings of need to close files, sockets, etc.
2017-01-04 10:33:48 +03:00
Damien George
54ea10a76a tests/pyb/uart: Update test to match recent change to UART timeout_char. 2017-01-04 17:53:41 +11:00
Max
e1f495a4bd docs/esp8266/tutorial: Close socket after reading page content. 2017-01-04 11:15:02 +11:00
Dave Hylands
3c84197f17 drivers/onewire: Enable pull up on data pin.
The driver seems to be be enabling the pullup resistor in most places, but
not this one. Making this one little change allows onewire devices to be
used with no external pullup resistor.
2017-01-03 17:19:22 +11:00
TheSpooler
3d96201165 esp8266/modesp: Fix a typo, print -> printf. 2017-01-03 17:10:13 +11:00
Damien George
3f9c45efd1 py/asmarm: Fix assembler's PASS_EMIT constant name. 2017-01-03 15:40:50 +11:00
Paul Sokolovsky
714a59ab64 esp8266/modesp: Make check_fw() work with OTA firmware. 2017-01-03 00:02:00 +03:00
Paul Sokolovsky
f5750e88c5 esp8266/Makefile: Produce OTA firmware as firmware-ota.bin. 2017-01-02 19:29:41 +03:00
Paul Sokolovsky
86d210951f esp8266/scripts/inisetup: Dump FS starting sector/size on error.
Should allow to diagnose/try to recover FS easier.
2017-01-02 18:52:35 +03:00
Paul Sokolovsky
5efd6508ec unix/moduselect: Fix nanbox build with recent changes. 2016-12-31 11:19:25 +03:00
Paul Sokolovsky
093a8f5fa2 unix/moduselect: If file object passed to .register(), return it in .poll().
This makes unix "uselect" compatible with baremetal "uselect". Previosuly,
unix version accepted file/socket objects, but internally converted that
to file descriptors, and that's what .poll() returned. To acheive new
behavior, file-like objects are stored internally in an array, in addition
to existing array of struct pollfd. This array is created only on first
case of file-like object being passed to .register(). If only raw fd's are
passed, there will be no additional memory used comparing to the original
implementation.
2016-12-31 00:07:18 +03:00