Paul Sokolovsky
85d809d1f4
tests: Convert remaining "sys.exit()" to "raise SystemExit".
2017-06-10 20:34:38 +03:00
Paul Sokolovsky
a2803b74f4
tests/basics: Convert "sys.exit()" to "raise SystemExit".
2017-06-10 20:03:01 +03:00
Paul Sokolovsky
0161939ed1
zephyr/machine_pin: Use native Zephyr types for Zephyr API calls.
...
In 1.8, Zephyr made a controversial change of dumping C99 stdint types
and switching to its own types.
2017-06-10 19:40:31 +03:00
Paul Sokolovsky
52410ef5b3
esp8266/Makefile: Add clean-modules target.
...
Helpful when dealing with frozen modules (and whole applications).
2017-06-10 18:13:43 +03:00
Scott Shawcroft
736a63e85a
atmel-samd: Set up the tcc_instance when using an already active TCC.
...
This fixes a hard lock that happens when using a second channel on an
in use TCC. The lock occurred when setting the duty cycle on the channel
because the hw address was not available to ASF.
Thanks to @ladyada for finding the bug.
2017-06-09 17:16:33 -07:00
Scott Shawcroft
3658c92270
atmel-samd: Reset TCC channel in use array on reset.
...
This fixes spurious "All timers in use" exceptions. Thanks to
@ladyada for finding this issue.
2017-06-09 17:15:31 -07:00
Scott Shawcroft
9434db07b2
atmel-samd: Handle TCC2 correctly. Unlike the other TCCs its 16bit
...
rather than 24bit. Setting the period for more than a 16bit number
caused the TCC to be in a weird state where resetting it would hard
crash.
Fixes #153
2017-06-09 15:29:02 -07:00
Scott Shawcroft
43881f933d
py: Prevent mp_arg_check_num from being optimized away by the compiler.
...
Also, change the MICROPY_ERROR_REPORTING checks to macros to make it
clear the compiler can handle it immediately.
Fixes #154
2017-06-09 11:20:53 -07:00
Paul Sokolovsky
07241cd37a
py/objstringio: If created from immutable object, follow copy on write policy.
...
Don't create copy of immutable object's contents until .write() is called
on BytesIO.
2017-06-09 17:33:01 +03:00
Damien George
b24ccfc639
py/makeqstrdefs.py: Make script run correctly with Python 2.6.
2017-06-09 13:42:13 +10:00
Damien George
a8a5d1e8c8
py: Provide mp_decode_uint_skip() to help reduce stack usage.
...
Taking the address of a local variable leads to increased stack usage, so
the mp_decode_uint_skip() function is added to reduce the need for taking
addresses. The changes in this patch reduce stack usage of a Python call
by 8 bytes on ARM Thumb, by 16 bytes on non-windowing Xtensa archs, and by
16 bytes on x86-64. Code size is also slightly reduced on most archs by
around 32 bytes.
2017-06-09 13:36:33 +10:00
Scott Shawcroft
a884acc7f6
atmel-samd: Fix PWMOut duty_cycle when used with TCC peripherals.
...
Fixes #148 . Fixes #151
2017-06-08 18:56:13 -07:00
Paul Sokolovsky
4352b944d2
zephyr: Define MICROPY_PY_SYS_PLATFORM (to "zephyr").
2017-06-08 17:58:55 +03:00
Paul Sokolovsky
e094200750
tests/float/builtin_float_minmax: PEP8 fixes.
2017-06-08 17:23:22 +03:00
Damien George
fde54350a8
tests/float: Convert "sys.exit()" to "raise SystemExit".
...
The latter is shorter and simpler because it doesn't require importing the
sys module.
2017-06-08 14:00:57 +10:00
Tamas TEVESZ
d80c951f71
unix/Makefile: replace references to make with $(MAKE)
...
make is not always GNU make; the latter may go by different names.
This helps builds on systems where the default make is not GNU make.
2017-06-08 13:42:23 +10:00
Tamas TEVESZ
1dd18c5260
esp8266/Makefile: replace references to make with $(MAKE)
...
make is not always GNU make; the latter may go by different names.
This helps builds on systems where the default make is not GNU make.
2017-06-08 13:42:23 +10:00
Damien George
22cedef95f
stmhal/usbdev: For MSC implement SCSI SYNCHRONIZE_CACHE command.
...
Currently just a dummy command that returns "success", but it's needed for
some O/S's to correctly talk with the SCSI layer.
2017-06-08 12:29:10 +10:00
Scott Shawcroft
9345562cc8
docs: Add note about composition to the design guide.
2017-06-07 14:57:55 -07:00
Scott Shawcroft
714521a4c7
shared-bindings: Update docs to remove with statements from examples but add more detail to the design guide about their use.
2017-06-07 14:39:12 -07:00
Scott Shawcroft
c5e515b8fe
docs: Add module support matrix.
2017-06-07 12:00:15 -07:00
Scott Shawcroft
2ecb9a3dbf
docs: Fix header lines that are too short.
2017-06-07 11:58:04 -07:00
Damien George
e1cda00387
py/modsys: Allow to compile with obj-repr D and PY_ATTRTUPLE disabled.
2017-06-08 00:41:27 +10:00
Damien George
326e8860ab
py/objstr: Allow to compile with obj-repr D, and unicode disabled.
2017-06-08 00:40:38 +10:00
Damien George
72732fea1a
py/persistentcode: Allow to compile with complex numbers disabled.
2017-06-08 00:28:28 +10:00
Damien George
4d2778c9fb
examples/embedding: Use core-provided KeyboardInterrupt object.
2017-06-07 20:28:18 +10:00
Damien George
f86c57fedf
stmhal/usb: Make state for USB device private to top-level USB driver.
2017-06-07 16:03:45 +10:00
Sylvain Pelissier
3bb69f645a
stmhal/usb: Use local USB handler variable in Start-of-Frame handler.
2017-06-07 16:03:19 +10:00
Sylvain Pelissier
6adcf7bb82
stmhal: Pass USB handler as parameter to allow more than one USB handler
2017-06-07 15:50:26 +10:00
Damien George
7ecfbb8267
extmod/vfs: Allow "buffering" and "encoding" args to VFS's open().
...
These args are currently ignored but are parsed to make it easier to
write portable scripts between CPython and MicroPython.
2017-06-07 15:29:53 +10:00
Damien George
f6ef8e3f17
extmod/vfs: Allow to statvfs the root directory.
2017-06-07 15:17:45 +10:00
Dave Hylands
551a731755
stmhal: Add support for NUCLEO_F446RE board.
2017-06-07 13:14:40 +10:00
Scott Shawcroft
c0e1f58b67
shared-bindings: Allow for switching direction with the attribute.
2017-06-06 17:45:39 -07:00
Scott Shawcroft
c8dc091288
shared-bindings: Fix duty_cycle parameter description and error message.
2017-06-06 16:23:06 -07:00
Scott Shawcroft
b5f50fadf9
atmel-samd: Change Metro PID to 0x8014 so it doesn't conflict with Arduino's PID.
2017-06-06 16:18:34 -07:00
Paul Sokolovsky
9db1c50f18
qemu-arm: Enable micropython.mem_*() functions to allow more tests.
2017-06-06 00:23:48 +03:00
Scott Shawcroft
9805abd858
Merge pull request #146 from dhalbert/stack_check-fix
...
Fix broken mp_stack_check() when using -flto
2017-06-05 11:51:27 -07:00
Dan Halbert
88b449a8cd
Fix broken mp_stack_check: force mp_stack_ctrl_init() and mp_stack_usage() not to be inlined even with -flto
2017-06-04 22:05:55 -04:00
Paul Sokolovsky
cd64b3082e
docs/network: First step to describe standard network class interface.
...
This adds description of implied AbstractNIC base class, which should be
"subclasses" and implemented by a particular network device class.
This is just an initial step in that direction, the API and description
will be elabotated further.
2017-06-04 21:25:23 +03:00
Paul Sokolovsky
50de6d2fab
extmod/modlwip: accept: Fix error code for non-blocking mode.
...
In non-blocking mode, if no pending connection available, should return
EAGAIN, not ETIMEDOUT.
2017-06-04 13:45:37 +03:00
Paul Sokolovsky
5da8de2b66
extmod/modlwip: Fix error codes for duplicate calls to connect().
...
If socket is already connected, POSIX requires returning EISCONN. If
connection was requested, but not yet complete (for non-blocking
socket), error code is EALREADY.
http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
2017-06-04 12:30:41 +03:00
Paul Sokolovsky
a0dbbbebb8
extmod/modlwip: connect: For non-blocking mode, return EINPROGRESS.
...
Instead of ETIMEDOUT. This is consistent with POSIX:
http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
2017-06-03 22:48:31 +03:00
Paul Sokolovsky
43f58386e0
zephyr/modusocket: getaddrinfo: Fix mp_obj_len() usage.
...
Return value is mp_obj_t, so needs to be accessed using
MP_OBJ_SMALL_INT_VALUE().
2017-06-03 16:11:53 +03:00
Paul Sokolovsky
f245f5d7cc
docs/machine: Sort machine classes in logical order, not alphabetically.
...
The list starts with the simplest functionality - GPIO, proceeds to
communication interfaces (UART, SPI, I2C), the to time(r) related
things, then everything else.
2017-06-03 14:50:54 +03:00
Paul Sokolovsky
e91b1cdae3
docs/uos: Move cc3200 port legacy VFS mounting functions to its ref doc.
...
This patch also unconditionalizes uos.dupterm(), though exact interface
and semantics is yet to be defined.
2017-06-03 14:19:53 +03:00
Paul Sokolovsky
1ce44f3046
docs/uos: Deconditionalize, remove minor port-specific details.
...
For a couple of ports, there was information which directory is set
as current after boot. This information doesn't belong to "uos" module,
and is moved to boards' references (which actually already contained
information on which directory is chosen for boot, even if without
explicit mentioning that it becomes current directory, which is now
done).
2017-06-03 13:51:13 +03:00
Paul Sokolovsky
92206a78ae
docs/network: Move confusingly-named cc3200 Server class to its reference.
...
cc3200 port has network.Server class to control behavior of builtin
Telnet/FTP server of that port.
2017-06-03 13:34:28 +03:00
Paul Sokolovsky
22ca5390f7
docs/esp8266/quickref: Polish Pin.on()/off() examples.
2017-06-02 21:08:23 +03:00
Damien George
7400d88762
tests/basics/string_rsplit: Add tests for negative "maxsplit" argument.
2017-06-02 13:08:18 +10:00
Damien George
9f85c4fe48
py/objstr: Catch case of negative "maxsplit" arg to str.rsplit().
...
Negative values mean no limit on the number of splits so should delegate to
the .split() method.
2017-06-02 13:07:22 +10:00