Commit Graph

6967 Commits

Author SHA1 Message Date
Paul Sokolovsky 99ed0f25cb unix/mphalport.h: Add warning of mp_hal_delay_ms() implementation.
It's implemented in terms of usleep(), and POSIX doesn't guarantee that
usleep() can sleep for more than a second. This restriction unlikely
applies to any real-world system, but...
2016-10-29 13:38:02 +03:00
Scott Shawcroft 7a24abb27c lib/utils/pyexec: Return FORCED_EXIT from pyexec_file when its stopped by CTRL - C. 2016-10-28 20:19:30 -07:00
Scott Shawcroft 5b3a143ffe atmel-samd: Rework tick timer to use TC5 and support neopixel status LED.
The tick timer needed to be reworked because the ASF delay functions also
use the SysTick timer. Now, it uses TC5 and calls out to the autoreset
logic every tick. Fixes #43.

Added neopixel status colors and corrected the latch time from ms to us.
Fixes #42.
2016-10-28 20:16:39 -07:00
Scott Shawcroft 9008b93962 atmel-samd: Fix typo in ASF. 2016-10-28 20:12:24 -07:00
Paul Sokolovsky 6ed5583f8c extmod/utime_mphal: ticks_diff(): switch arg order, return signed value.
Based on the earlier discussed RFC. Practice showed that the most natural
order for arguments corresponds to mathematical subtraction:

ticks_diff(x, y) <=> x - y

Also, practice showed that in real life, it's hard to order events by time
of occurance a priori, events tend to miss deadlines, etc. and the expected
order breaks. And then there's a need to detect such cases. And ticks_diff
can be used exactly for this purpose, if it returns a signed, instead of
unsigned, value. E.g. if x is scheduled time for event, and y is the current
time, then if ticks_diff(x, y) < 0 then event has missed a deadline (and e.g.
needs to executed ASAP or skipped). Returning in this case a large unsigned
number (like ticks_diff behaved previously) doesn't make sense, and such
"large unsigned number" can't be reliably detected per our definition of
ticks_* function (we don't expose to user level maximum value, it can be
anything, relatively small or relatively large).
2016-10-29 05:02:24 +03:00
Paul Sokolovsky e381efed4a unix/modtime: Use ticks_diff() implementation from extmod/utime_mphal.c. 2016-10-29 04:58:06 +03:00
Paul Sokolovsky aee6483536 zephyr/README: Update for the current featureset, add more info. 2016-10-28 21:51:18 +03:00
Paul Sokolovsky 938c693948 zephyr: Support time -> utime module "weaklink".
So, now it's possible to just do normal Python's "import time".
2016-10-28 21:38:52 +03:00
Alex March cc0cc67815 tests/extmod/uhashlib_sha256: Rename sha256.py test. 2016-10-28 19:51:54 +03:00
Alex March b83ac44e82 tests/extmod/uhashlib_sha1: Coverage for SHA1 algorithm. 2016-10-28 19:51:46 +03:00
Paul Sokolovsky b0feef7a57 zephyr/zephyr_getchar: Update for recent Zephyr refactor of console hooks.
uart_irq_input_hook_set() was renamed to uart_console_in_debug_hook_install()
and accepts different params.
2016-10-28 17:53:10 +03:00
Paul Sokolovsky c28f9df63a docs/library/network: Typo fixes, consistent acronym capitalization. 2016-10-28 12:03:35 +03:00
Paul Sokolovsky b9a88683a4 docs/library/network: Reword intro paragraph. 2016-10-28 04:42:27 +03:00
Scott Shawcroft fc78f6950f atmel-samd: Add D13 as flash write indicator on Arduino Zero. 2016-10-27 17:49:52 -07:00
Scott Shawcroft 86a1d1db30 atmel-samd: Fix autoreset when no repl is present and keep running mss storage code during a sleep. 2016-10-27 17:48:42 -07:00
Alex March 964fb2450e tests/basics/gc1: Garbage collector threshold() coverage. 2016-10-27 22:15:42 +03:00
Paul Sokolovsky 8a49905a2f py/stream: Typo fix in comment. 2016-10-27 22:13:45 +03:00
Scott Shawcroft 3a9cb1ac49 atmel-samd: Fix Arduino SPI pin. Datasheet net name is wrong. :-( 2016-10-26 20:16:53 -07:00
Alex March 52aa532050 qemu-arm: Exclude new vfs_fat tests. 2016-10-27 12:25:28 +11:00
Alex March fbca4f94b3 tests/extmod/vfs_fat_oldproto: Test old block device protocol. 2016-10-27 12:22:43 +11:00
Alex March 38a9359339 tests/extmod/vfs_fat_fsusermount: Improve fsusermount test coverage. 2016-10-27 12:22:42 +11:00
Scott Shawcroft 85e4d3572d atmel-samd: Add named pins for Arduino Zero SPI. Fixes #11. 2016-10-26 18:02:34 -07:00
Scott Shawcroft 2098515f6a atmel-samd: Rework pin definitions to share most of the data structures and included based on ASF defines. 2016-10-26 17:57:47 -07:00
Daniel Thompson 67b6d9d499 zephyr: Initial implementation of machine.Pin.
The integration with Zephyr is fairly clean but as MicroPython Hardware API
requires pin ID to be a single value, but Zephyr operates GPIO in terms of
ports and pins, not just pins, a "hierarchical" ID is required, using tuple
of (port, pin). Port is a string, effectively a device name of a GPIO port,
per Zephyr conventions these are "GPIO_0", "GPIO_1", etc.; pin is integer
number of pin with the port (supposed to be in range 0-31).

Example of pin initialization:

pin = Pin(("GPIO_1", 21), Pin.OUT)

(an LED on FRDM-K64F's Port B, Pin 21).

There is support for in/out pins and pull up/pull down but currently
there is no interrupt support.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-10-27 00:47:26 +03:00
Scott Shawcroft 73848f4cd0 atmel-samd: Stop aliasing os to uos and time to utime. They expose different APIs. Fixes #23. 2016-10-26 13:33:50 -07:00
Scott Shawcroft 34fa81eaf3 atmel-samd: Hook in DTR for more ports and make the serial TX more resiliant to long strings. 2016-10-26 13:32:41 -07:00
Scott Shawcroft 04284a9fe3 Merge pull request #38 from tannewt/autoreset
atmel-samd: Support auto-reset based on USB write activity.
2016-10-26 11:12:55 -07:00
Vincenzo Frascino a3519332b6 zephyr: Use board/SoC values for startup banner based on Zephyr config.
This patch modifies the HW macro definition in order to let micropython
report correctly the BOARD and the SOC on which it is working on.
2016-10-26 19:00:16 +03:00
Paul Sokolovsky 3cdccb9b14 zephyr: Fix mp_hal_set_interrupt_char() declaration to be compatible.
With other ports. Other ports declare it in mphalport.h, it can be
inline or macro.
2016-10-26 17:53:28 +03:00
Paul Sokolovsky 6832cbd69d lib/utils/pyexec: Fix compilation warning of type vs format mismatch.
This happens with some compilers on some architectures, which don't define
size_t as unsigned int. MicroPython's printf() dooesn't support obscure
format specifiers for size_t, so the obvious choice is to explicitly cast
to unsigned, to match %u used in printf().
2016-10-26 13:45:03 +03:00
Vincenzo Frascino c38ea32810 lib/utils/pyexec: Add mp_hal_set_interrupt_char() prototype.
This patch removes a compilation warning in pyexec.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-10-26 13:42:27 +03:00
Paul Sokolovsky 73b72799f3 examples/http_server_simplistic: Add "not suitable for real use" note. 2016-10-26 12:25:33 +03:00
Scott Shawcroft d189a3f3cf atmel-samd: Support auto-reset based on USB write activity.
It will soft-reboot micropython after a burst of writes to the
file system. This means that after you save files on your computer
they will be automatically rerun.

This can be disabled in the build by unsetting AUTORESET_TIMER in
mpconfigboard.h.

Using the REPL will also prevent the soft resets until you reset
with CTRL-D manually.
2016-10-25 18:36:37 -07:00
Scott Shawcroft 614c1fdba2 atmel-samd: Only output to USB after DTR and don't send anything larger than the room left in the USB TX buffer. 2016-10-25 18:29:04 -07:00
Paul Sokolovsky f00ecdb54d extmod/moduos_dupterm: Renamed to uos_dupterm.
As part of file naming clean up (moduos_dupterm doesn't implement a
full module, so should skip "mod" prefix, similar to other files in
extmod/).
2016-10-26 02:08:37 +03:00
Scott Shawcroft b7768a74a7 atmel-samd: Fix file system init.
Adding the USB write protection prevented file system reset from
working. Since it happens before USB start we temporarily set the
volume to writeable and then set it back to read-only before USB is
started.
2016-10-25 15:13:43 -07:00
Scott Shawcroft d05299f57a atmel-samd: Add D13 led as mass storage write indicator. 2016-10-25 15:06:05 -07:00
Scott Shawcroft 3a5aad516a atmel-samd: Remove unused header. 2016-10-25 15:04:20 -07:00
Scott Shawcroft fff96a0ce6 atmel-samd: Fix include guard. 2016-10-25 15:03:22 -07:00
Paul Sokolovsky 67c91df7e8 docs/machine.SPI.rst: Fix typos and formatting, clarify.
Clarify the class implements master side of the protocol, also put adhoc
WiPy paramter after the generic, described in the current Hardware API
version.
2016-10-25 17:03:35 +03:00
Paul Sokolovsky 760ed4629f unix/Makefile: Remove references to deprecated pip-micropython. 2016-10-25 13:11:08 +03:00
Paul Sokolovsky d5cf8c5753 .travis.yml: minimal: Use CROSS=1, for binary size check.
x86 has bloated alignements, etc. Use ARM binary to catch any code size
increases promptly.
2016-10-25 11:43:56 +03:00
Paul Sokolovsky ca008bfd2d .travis.yml: Integrate tools/check_code_size.sh. 2016-10-25 11:43:55 +03:00
Paul Sokolovsky f7aa692093 tools/check_code_size.sh: Code size validation script for CI. 2016-10-25 11:43:55 +03:00
Radomir Dopieralski 984a867341 esp8266/scripts: Make neopixel/apa102 handle 4bpp LEDs with common code.
The NeoPixel class now handles 4 bytes-per-pixel LEDs (extra byte is
intensity) and arbitrary byte ordering.  APA102 class is now derived from
NeoPixel to reduce code size and support fill() operation.
2016-10-25 14:21:07 +11:00
Damien George f1b2b1b600 docs/library/builtins: Add docs for delattr and slice. 2016-10-25 11:02:47 +11:00
Paul Sokolovsky 2550d7dfd2 esp8266: Add support for building firmware version for 512K modules.
To build, "make 512k".

Disabled are FatFs support (no space for filesystem), Python functionality
related to files, btree module, and recently enabled features. With all
this, there's only one free FlashROM page.
2016-10-25 00:43:11 +03:00
Scott Shawcroft 16584dfee6 atmel-samd: Fix the Feather builds by switching to the VFS mass storage implementation. 2016-10-24 12:42:09 -07:00
Scott Shawcroft 82526b803c Add Travis CI badge. 2016-10-24 12:33:59 -07:00
Scott Shawcroft 58f37fc013 Build mpy-cross first because other builds depend on it. 2016-10-24 12:12:22 -07:00