Commit Graph

10362 Commits

Author SHA1 Message Date
Paul Sokolovsky c1e0eb7afe unix/main: Don't allow to specify too small heap size.
This will lead to crash like:

FATAL: uncaught NLR 80a5420

On x86_32, the minimum heap size is smaller, but not 2 times, so just
use value which works for x86_64.
2017-05-06 11:43:37 +03:00
Damien George 0986675451 stmhal: Convert all module and method tables to use MP_ROM macros. 2017-05-06 17:03:40 +10:00
Damien George 084824f866 tests: Move super-as-local test from cpydiff to basic tests.
It's now possible to use the name "super" as a local variable.
2017-05-06 11:01:57 +10:00
Damien George dce7dd4259 tests/micropython: Add test for int.from_bytes with many zero bytes. 2017-05-06 10:29:09 +10:00
Damien George 58bb73e010 py/objint: In int.from_bytes, only create big-int if really needed.
This patch ensures that int.from_bytes only creates a big-int if necessary,
by checking the value for a small-int overflow as it's being parsed.
2017-05-06 10:29:09 +10:00
Scott Shawcroft c6d539ace3 atmel-samd: Fix sporadic "syntax errors"
The GC was deleting memory that was in use because its scan of the
stack missed the very top. Switching to _estack fixes this by relying
on the location from the linker.

Fixes #124
2017-05-05 12:04:20 -07:00
Tom Collins 288ea06e7c lib/utils/pyexec: Update event-driven REPL to match non-event REPL.
Don't print dupe ">>> " prompt when starting event-driven REPL.  Clear
incomplete line in transition from raw to friendly REPL.
2017-05-05 22:15:47 +10:00
Damien George e62235f8c7 esp8266: Change default settings to mount flash at root dir. 2017-05-05 20:15:10 +10:00
Damien George 1b3e372418 tests/extmod: Add some more VFS tests. 2017-05-05 20:15:10 +10:00
Damien George 6c8b57a902 tests/extmod: Add more tests for VFS FAT. 2017-05-05 20:15:10 +10:00
Damien George c9a3a68a49 extmod/vfs: Allow a VFS to be mounted at the root dir.
This patch allows mounting of VFS objects right at the root directory, eg
os.mount(vfs, '/').  It still allows VFS's to be mounted at a path within
the root, eg os.mount(vfs, '/flash'), and such mount points will override
any paths within a VFS that is mounted at the root.
2017-05-05 20:15:10 +10:00
Paul Sokolovsky d4c070415a tools/upip: Upgrade to 1.2.
Memory optimizations and error handling improvements.
2017-05-05 13:12:19 +03:00
Scott Shawcroft 5ad426124b atmel-samd: Move heap objects into MICROPY_PORT_ROOT_POINTERS so they don't get garbage collected while we are using them. 2017-05-04 11:57:51 -07:00
Glenn Ruben Bakke 311ae77dc0 nrf5/modules/music: Backing up progress in modmusic. 2017-05-04 00:18:05 +02:00
Paul Sokolovsky 12ea06567c tests/cpydiff/core_function_unpacking: Fill in workaround. 2017-05-04 00:48:48 +03:00
Scott Shawcroft 6512ccf32e atmel-samd: Use DMA for user SPI.
Also replace use of PINMUX_DEFAULT with PINMUX_UNUSED to prevent any
accidental pin changes. This caused user SPI to break internal SPI
flash on the Feather M0 Express.

Fixes #100
2017-05-03 10:50:29 -07:00
Paul Sokolovsky 92657c671f tests/cpydiff/core_import_split_ns_pkgs: Test for split namespace packages. 2017-05-03 17:16:19 +03:00
Paul Sokolovsky 3923f96dc6 tests/cpydiff/core_import_path: Test showing difference in package.__path__. 2017-05-03 12:22:53 +03:00
stijn ab4a8618cf msvc: Workaround parser bug in older MSBuild versions
Versions prior to v14.0 have a bug in parsing item functions when used
within a condition: https://github.com/Microsoft/msbuild/issues/368.
Since commit [db9c2e3] this results in an error when building MicroPython
with for example VS2013.
Fix this by creating an intermediate property.
2017-05-03 10:41:53 +10:00
stijn 5b57ae985f mpy-cross: Fix compiler detection for including windows/fmode.c
fmode.c should only be included for builds targetting 'pure' windows, i.e.
msvc or mingw builds but not when using msys or cygwin's gcc (see #2298).
Just checking if the OS is windows and UNAME doesn't have msys stil leaves
the gate open for builds with cygwin's gcc since UNAME there is e.g.
CYGWIN_NT-6.1-WOW.
Fix this by checking for 'mingw' explicitly in the compiler version; both
gcc and clang have the -dumpmachine flag so the check should be ok for
all platforms.
2017-05-03 10:37:51 +10:00
Paul Sokolovsky 7d4ba9d257 tests/io/resource_stream: Add test for uio.resource_stream(). 2017-05-03 01:47:14 +03:00
Paul Sokolovsky d7da2dba07 py/modio: Implement uio.resource_stream(package, resource_path).
The with semantics of this function is close to
pkg_resources.resource_stream() function from setuptools, which
is the canonical way to access non-source files belonging to a package
(resources), regardless of what medium the package uses (e.g. individual
source files vs zip archive). In the case of MicroPython, this function
allows to access resources which are frozen into the executable, besides
accessing resources in the file system.

This is initial stage of the implementation, which actually doesn't
implement "package" part of the semantics, just accesses frozen resources
from "root", or filesystem resource - from current dir.
2017-05-03 01:47:08 +03:00
Scott Shawcroft 24a5752f94 atmel-samd: Use DMA for SPI flash block transfers.
Fixes #99
2017-05-02 15:25:06 -07:00
Glenn Ruben Bakke a7f10336e1 nrf5/modules/music: backing up porting progress in modmusic.c. 2017-05-02 22:40:31 +02:00
Paul Sokolovsky 4c2fa83f2a zephyr/main: Remove superfluous include. 2017-05-02 23:35:13 +03:00
Paul Sokolovsky b5159a9149 zephyr/mpconfigport.h: Enable line number information for scripts. 2017-05-02 23:33:16 +03:00
Glenn Ruben Bakke d170ca5d03 nrf5/modules/music: Commenting out backend function calls in modmusic.c to make module compile for now. 2017-05-02 21:50:54 +02:00
Paul Sokolovsky c1b19115e5 tests/cpydiff/core_import_prereg: Fill in cause and workaround. 2017-05-02 14:12:52 +03:00
Limor "Ladyada" Fried a2c463deb0 Update AudioOut.c
fiiiiiiiiiiiiiiiiiiiiiiiiix
2017-05-01 23:32:37 -04:00
Paul Sokolovsky 8bb84cc627 tests/cpydiff/core_function_userattr: Clarify, fill in cause and workaround. 2017-05-02 03:43:21 +03:00
Paul Sokolovsky 58ecbc7752 tests/cpydiff/core_arguments: Fill in cause/workaround. 2017-05-02 03:36:47 +03:00
Glenn Ruben Bakke 57442c2b25 nrf5/modules/music: Updating music module to use pin_obj_t instad of microbit_pin_obj_t. Update include to drivers/pwm.h to resolve some undefined functions. 2017-05-02 01:09:59 +02:00
Glenn Ruben Bakke 40b37227a0 nrf5/drivers/pwm: Work in progress commit of soft PWM from microbit repo. 2017-05-02 01:07:52 +02:00
Scott Shawcroft 7187132d24 tools: Switch method of detecting travis so that it works OK on CIs without artifacts saved. 2017-05-01 15:12:52 -07:00
Scott Shawcroft dd64379c0d py: Fix version header generation when no tags are available. 2017-05-01 15:12:52 -07:00
Paul Sokolovsky 674da04e2e zephyr/Makefile: Add debugserver Zephyr target. 2017-05-02 01:12:02 +03:00
Scott Shawcroft 58b9789d0c atmel-samd: Introduce audio sample playback via audioio.AudioOut. 2017-05-01 13:10:03 -07:00
Scott Shawcroft 30b8091df0 atmel-samd: Clean up leftovers from QTouch. 2017-05-01 11:32:15 -07:00
Scott Shawcroft 4ad22144b0 atmel-samd: Rename metro M0 Express and add NEOPIXEL pin. 2017-05-01 11:29:51 -07:00
Glenn Ruben Bakke 10e6b4309b nrf5/modules/music: Removing c++ extern definition. Updating include list in modmusic.c. Removing module name from module struct. 2017-05-01 19:55:43 +02:00
Glenn Ruben Bakke 01441c8f59 nrf5/modules/music: Removing include of modmicrobit.h in musictunes.c. 2017-05-01 19:52:40 +02:00
Glenn Ruben Bakke e766c7ebbe nrf5/modules/music: Adding header to expose extern structs defined in musictunes.c 2017-05-01 19:51:47 +02:00
Glenn Ruben Bakke 5c6fc791e3 nrf5/drivers: Adding copy of microbit soft pwm. 2017-05-01 19:13:50 +02:00
Glenn Ruben Bakke eedd9eabe9 nrf5/modules/music: Renaming microbitmusic files to modmusic/music. 2017-05-01 19:11:44 +02:00
Glenn Ruben Bakke 20bdb7dc90 nrf5/modules/music: Renaming microbit module to music. 2017-05-01 19:08:36 +02:00
Glenn Ruben Bakke f9b9d59434 nrf5/modules/microbit: Copying microbit music module to the port. 2017-05-01 19:06:49 +02:00
Paul Sokolovsky 11bc21dfa8 unix/main: Ignore SIGPIPE signal, instead make EPIPE arrive.
Do not raise SIGPIPE, instead return EPIPE. Otherwise, e.g. writing
to peer-closed socket will lead to sudden termination of MicroPython
process. SIGPIPE is particularly nasty, because unix shell doesn't
print anything for it, so the above looks like completely sudden and
silent termination for unknown reason. Ignoring SIGPIPE is also what
CPython does. Note that this may lead to problems using MicroPython
scripts as pipe filters, but again, that's what CPython does. So,
scripts which want to follow unix shell pipe semantics (where SIGPIPE
means "pipe was requested to terminate, it's not an error"), should
catch EPIPE themselves.
2017-05-01 18:47:26 +03:00
Paul Sokolovsky 5db55e63f3 extmod/modlwip: ioctl POLL: Fix handling of peer closed socket.
Peer-closed socket is both readable and writable: read will return EOF,
write - error. Without this poll will hang on such socket.

Note that we don't return POLLHUP, based on argumentation in
http://www.greenend.org.uk/rjk/tech/poll.html that it should apply to
deeper disconnects, for example for networking, that would be link layer
disconnect (e.g. WiFi went down).
2017-05-01 18:20:09 +03:00
stijn c41fe70ef2 windows/README: Add a note about stack usage for msvc
Add information as discussed in #2927 to the readme to make the easier
to discover.
2017-05-01 12:06:43 +02:00
stijn fa823ea893 windows/README: Fix some typos and grammar 2017-05-01 11:58:47 +02:00