Commit Graph

8368 Commits

Author SHA1 Message Date
Girts Folkmanis af1ede930b esp8266: fix "uos" includes
Fix couple places in startup scripts that still had "import uos". This
would cause an exception when _boot.py was executed during startup.
2017-07-22 21:18:37 -04:00
Scott Shawcroft bd4a975530 docs: Minor updates before 1.0.0 2017-07-19 15:13:23 -04:00
Dan Halbert 0d2c1bf2bb Fix problems that prevented use of internal frozen modules:
1. Allow -Wlto-type-mismatch to be just a warning when building with frozen modules.
2. Fix extern decls that triggered -Wnested-externs when building with frozen modules.
3. Pass the correct value of -mlongint-impl to $(MPY_TOOL). New file mpconfigport.mk to do this.
2017-07-16 16:00:41 -07:00
Scott Shawcroft af823e64c4 docs: tweak css so a horizontal scroll bar shows up on the wide pinout tables. Fixes #166 2017-07-14 11:28:39 -07:00
Scott Shawcroft c82b84e0a9 atmel-samd: Fix potential buffer overflow in UART.c by recalculating
the buffer end rather than naively adding 1. It could have needed to
wrap around. Thanks @dhalbert for spotting the bug.

Fixes #132
2017-07-13 16:21:12 -07:00
Scott Shawcroft 3660023046 atmel-samd: Update README and add pinout tables that map MCU names
to names in the board module and explain pin capabilities.

Fixes #149
2017-07-13 16:05:24 -07:00
Scott Shawcroft b69507fc64 shared-bindings: Fix neopixel_write example. I forgot to save in the editor. Fixes #163 2017-07-12 14:59:26 -07:00
Scott Shawcroft 1e04e8ea1c atmel-samd: Reboot to bootloader when a 1200 baud serial connection is
closed. This is how Arduino triggers the bootloader.
2017-07-12 11:58:22 -07:00
Scott Shawcroft 09b80b10d1 atmel-samd: Add Trinket Rev D support. 2017-07-12 11:55:50 -07:00
Scott Shawcroft 94346d97ba atmel-samd: Add TX/RX and SCL/SDA pins names for Gemma M0. 2017-07-12 11:55:50 -07:00
Scott Shawcroft e02e423510 atmel-samd: Switch streams to non-blocking mode. Fixes #159. 2017-07-12 11:55:50 -07:00
Scott Shawcroft ffc37faadc atmel-samd: Update Gemma M0 USB device name. 2017-07-12 11:55:49 -07:00
Scott Shawcroft 309daaf5fc atmel-samd: Update Gemma M0 for release revision. 2017-07-12 11:55:49 -07:00
Scott Shawcroft 97df799e2c atmel-samd: Add IR_TX and IR_RX pin names for REMOTEOUT and REMOTEIN to the CircuitPlayground Express pins to match the silkscreen. 2017-07-12 11:55:49 -07:00
Dan Halbert 2cd62b46cd Fix USB Busy error for kbd hid. Made kbd USB report descriptor be
COMPILER_WORD_ALIGNED as done in #118 for mouse. Added COMPILER_WORD_ALIGNED
to other UDC_DESC_STORAGE declarations that might have the same issue in
the future.
2017-07-12 11:55:49 -07:00
Scott Shawcroft f878bc4efc atmel-samd: Fix AudioOut buffer playback by supporting bytes_per_sample.
Thanks to @ntoll for finding this bug!
2017-07-12 11:55:49 -07:00
Scott Shawcroft 5e231bd8f9 shared-bindings: Add neopixel_write example. Fixes #163 2017-07-12 11:55:17 -07:00
Scott Shawcroft b6ebf855d3 Update README with os and random info. 2017-06-29 17:30:02 -07:00
Scott Shawcroft 3bf6303081 Add link to discord chat. 2017-06-29 17:17:50 -07:00
Scott Shawcroft 725d715a1b shared-bindings: Introduce storage.remount() so you can set root as
writeable and prevent USB from editing it.
2017-06-28 16:18:13 -07:00
Scott Shawcroft 1e16e813e8 atmel-samd: Update sys.path with correct root path. 2017-06-28 14:53:01 -07:00
Scott Shawcroft 05f0681966 atmel-samd: update boot output location for new mount point. 2017-06-28 14:51:46 -07:00
Scott Shawcroft d6a24afd71 Change vfs mount ordering such that the root is always last in the
linked list. Its also the only one statically allocated and made
available over USB.
2017-06-28 14:46:49 -07:00
Scott Shawcroft 5ddbf26b62 atmel-samd: Update sys.path to match that the internal/onboard
flash is now at / rather than /flash.
2017-06-28 12:52:29 -07:00
Scott Shawcroft c797f3cb24 shared-module: Fix os.listdir to correctly return list rather than
iterator.
2017-06-28 12:51:32 -07:00
Scott Shawcroft a0058e6712 Introduce a random module that is a subset of CPython's random. It
also initializes in the same way where it takes from a true random
source when available through os.urandom(). After initializing, it
produces deterministic results until the seed is set.

This replaces urandom!

Fixes #139.
2017-06-27 17:37:24 -07:00
Scott Shawcroft 265d5dab05 docs: Typos and rename to CircuitPython. 2017-06-27 17:37:03 -07:00
Scott Shawcroft 778e975936 Split uos module into os and storage.
os is a subset of CPython's os. storage contains additional
file system mounting functionality based on UNIX's mount
management.

Fixes #140
2017-06-27 15:17:30 -07:00
Scott Shawcroft e87a61ffb4 atmel-samd: Fix running off of the new VFS filesystem including
an issue at startup leading to safe mode and mass storage support
not working.
2017-06-26 14:04:22 -07:00
Scott Shawcroft 8251d8cb2a travis: Turn off coveralls. 2017-06-20 18:09:38 -07:00
Scott Shawcroft df20b28805 minimal: Update mp_builtin_open signature to match new function type. 2017-06-20 17:52:36 -07:00
Scott Shawcroft 03a7069d60 py: Change asm form to make minimal port happy. 2017-06-20 17:52:13 -07:00
Scott Shawcroft 30ee7019ca Merge tag 'v1.9.1'
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions

This release provides an important fix for the USB mass storage device in
the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which
is now require by some Operating Systems.  There are also fixes for the
lwIP bindings to improve non-blocking sockets and error codes.  The VFS has
some regressions fixed including the ability to statvfs the root.

All changes are listed below.

py core:
- modbuiltins: add core-provided version of input() function
- objstr: catch case of negative "maxsplit" arg to str.rsplit()
- persistentcode: allow to compile with complex numbers disabled
- objstr: allow to compile with obj-repr D, and unicode disabled
- modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled
- provide mp_decode_uint_skip() to help reduce stack usage
- makeqstrdefs.py: make script run correctly with Python 2.6
- objstringio: if created from immutable object, follow copy on write policy

extmod:
- modlwip: connect: for non-blocking mode, return EINPROGRESS
- modlwip: fix error codes for duplicate calls to connect()
- modlwip: accept: fix error code for non-blocking mode
- vfs: allow to statvfs the root directory
- vfs: allow "buffering" and "encoding" args to VFS's open()
- modframebuf: fix signed/unsigned comparison pendantic warning

lib:
- libm: use isfinite instead of finitef, for C99 compatibility
- utils/interrupt_char: remove support for KBD_EXCEPTION disabled

tests:
- basics/string_rsplit: add tests for negative "maxsplit" argument
- float: convert "sys.exit()" to "raise SystemExit"
- float/builtin_float_minmax: PEP8 fixes
- basics: convert "sys.exit()" to "raise SystemExit"
- convert remaining "sys.exit()" to "raise SystemExit"

unix port:
- convert to use core-provided version of built-in import()
- Makefile: replace references to make with $(MAKE)

windows port:
- convert to use core-provided version of built-in import()

qemu-arm port:
- Makefile: adjust object-file lists to get correct dependencies
- enable micropython.mem_*() functions to allow more tests

stmhal port:
- boards: enable DAC for NUCLEO_F767ZI board
- add support for NUCLEO_F446RE board
- pass USB handler as parameter to allow more than one USB handler
- usb: use local USB handler variable in Start-of-Frame handler
- usb: make state for USB device private to top-level USB driver
- usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command
- convert from using stmhal's input() to core provided version

cc3200 port:
- convert from using stmhal's input() to core provided version

teensy port:
- convert from using stmhal's input() to core provided version

esp8266 port:
- Makefile: replace references to make with $(MAKE)
- Makefile: add clean-modules target
- convert from using stmhal's input() to core provided version

zephyr port:
- modusocket: getaddrinfo: Fix mp_obj_len() usage
- define MICROPY_PY_SYS_PLATFORM (to "zephyr")
- machine_pin: use native Zephyr types for Zephyr API calls

docs:
- machine.Pin: remove out_value() method
- machine.Pin: add on() and off() methods
- esp8266: consistently replace Pin.high/low methods with .on/off
- esp8266/quickref: polish Pin.on()/off() examples
- network: move confusingly-named cc3200 Server class to its reference
- uos: deconditionalize, remove minor port-specific details
- uos: move cc3200 port legacy VFS mounting functions to its ref doc
- machine: sort machine classes in logical order, not alphabetically
- network: first step to describe standard network class interface

examples:
- embedding: use core-provided KeyboardInterrupt object
2017-06-20 10:56:05 -07:00
Scott Shawcroft 97fcdfbd08 docs: Update design guide for new DigitalInOut API. 2017-06-19 09:06:46 -07:00
Scott Shawcroft a715bf6bac atmel-samd: Introduce board reset mechanic used on CircuitPlayground
Express to ensure the Neopixels are off after reloads.
2017-06-16 15:40:15 -07:00
Scott Shawcroft 3e23464b1e atmel-samd: Add user initiated safe mode and rework board.c for
board specific functionality.

Fixes #155
2017-06-16 14:55:53 -07:00
Scott Shawcroft c7efd2cae9 shared-bindings: Move enum-like classes out of DigitalInOut into digitalio.
Also, rename Direction.IN to Direction.INPUT and Direction.OUT to Direction.OUTPUT.

This simplifies using them. Prior to the nativeio split this would have led to
clutter in the top-level namespace but having digitalio prevents this.

Fixes #152
2017-06-16 13:47:01 -07:00
Scott Shawcroft 58ab5844cb atmel-samd: Fix sharing TCCs by statically storing the current period.
A previous fix improved the duty_cycle channel value computation by
removing the reliance on the PER register which gave old values. It
saved the period on the object but failed to set anything for reused
timers. So, this breaks it out into a separate array that can be
shared across all object regardless of whether it used a new or
existing timer.
2017-06-12 15:37:09 -07:00
Scott Shawcroft c61e1b89aa atmel-samd: Fix TCC1, its two channels and four wave outputs.
Previously it was configured as four and four which configured
the incorrect channels.
2017-06-12 15:36:09 -07:00
Damien George 869cdcfdfc docs: Bump version to 1.9.1. 2017-06-11 23:04:00 +10:00
Damien George f55dcddbc7 tests/extmod/vfs_basic: Allow test to pass on embedded targets. 2017-06-11 22:56:27 +10:00
Paul Sokolovsky 0a7735f1a6 extmod/modframebuf: Fix signed/unsigned comparison pendantic warning.
Happened with 32-bit gcc 4.8.4.
2017-06-10 20:34:38 +03:00
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