summaryrefslogtreecommitdiff
path: root/atmel-samd/main.c
AgeCommit message (Collapse)Author
2017-09-22Move to ASF4 and introduce SAMD51 support. (#258)3.0.0-alpha.0Scott Shawcroft
* atmel-samd: Remove ASF3. This will break builds. * atmel-samd: Add ASF4 for the SAMD21 and SAMD51. * Introduce the supervisor concept to facilitate porting. The supervisor is the code which runs individual MicroPython VMs. By splitting it out we make it more consistent and easier to find. This also adds very basic SAMD21 and SAMD51 support using the supervisor. Only the REPL currently works. This begins the work for #178.
2017-09-06atmel-samd: Ensure MTB is off in case we ran a debug build beforeScott Shawcroft
a non-debug build.
2017-09-01Fix issue #207, esp8266 file operations problems (#222)Dan Halbert
The frozen module `_boot.py` was not being loaded on restart because `pyexec_frozen_module()` did not know about the new `.frozen` pseudo-directory. Updated lower-level routine to look in the right place. Also made ".frozen" and related values be `#define`s.
2017-08-31Add ".frozen" to end of sys.path, so that internal frozen modules are ↵Dan Halbert
visible on boot.
2017-08-25atmel-samd: Introduce a nvm module for non-volatile byte-level memory ↵Scott Shawcroft
access. (#203) * atmel-samd: Introduce a nvm module for non-volatile byte-level memory access. This allows for persisting small configuration values even when the file system is read-only from CircuitPython. Fixes #160 * Review feedback: * Add tests. * Fix non-zero index. * Fix len()
2017-08-05Increase heap size at the expense of stack size, from 16k to 16k+4k.Dan Halbert
2017-07-28atmel-samd: Introduce audiobusio.PDMIn for recording audio from PDMScott Shawcroft
microphones.
2017-07-23Measure and report maximum stack usage. (#175)Dan Halbert
Add max stack usage tracking, visible via debug module ustack. Add separate cpp flag for enabling modules: MICROPY_DEBUG_MODULES
2017-06-28shared-bindings: Introduce storage.remount() so you can set root asScott Shawcroft
writeable and prevent USB from editing it.
2017-06-28atmel-samd: Update sys.path with correct root path.Scott Shawcroft
2017-06-28atmel-samd: Update sys.path to match that the internal/onboardScott Shawcroft
flash is now at / rather than /flash.
2017-06-26atmel-samd: Fix running off of the new VFS filesystem includingScott Shawcroft
an issue at startup leading to safe mode and mass storage support not working.
2017-06-20Merge tag 'v1.9.1'2.0.0-alpha.0Scott Shawcroft
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-16atmel-samd: Introduce board reset mechanic used on CircuitPlayground1.0.0-rc.1Scott Shawcroft
Express to ensure the Neopixels are off after reloads.
2017-06-16atmel-samd: Add user initiated safe mode and rework board.c forScott Shawcroft
board specific functionality. Fixes #155
2017-05-24atmel-samd: correctly reset the REPL history on reload. Fixes #141Scott Shawcroft
2017-05-20atmel-samd: Enable autoreload by default again.0.10.1Scott Shawcroft
2017-05-15atmel-samd: Fixup autoreset after switching boot to running once.0.10.0Scott Shawcroft
2017-05-15atmel-samd: Add a safe mode which detects hard faults and reboots without ↵Scott Shawcroft
running user code again.
2017-05-12atmel-samd: Rework boot, main and REPL order.Scott Shawcroft
Boot will only run once now before USB is started. Its output goes to boot_out.txt. After main and REPL will run with VM and hardware resets between each.
2017-05-12atmel-samd: Rename auto-reset to auto-reload to reduce confusion with ↵Scott Shawcroft
physical reset buttons.
2017-05-12atmel-samd: Pin reset improvements.Scott Shawcroft
* Reset SWD lines to SWD rather than GPIO. This makes OpenOCD happier. * Default speaker enable lines to False for CircuitPlayground to prevent the speaker from buzzing when no sound is playing. Fixes #126
2017-05-05atmel-samd: Fix sporadic "syntax errors"Scott Shawcroft
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-02atmel-samd: Use DMA for SPI flash block transfers.Scott Shawcroft
Fixes #99
2017-05-01atmel-samd: Introduce audio sample playback via audioio.AudioOut.Scott Shawcroft
2017-04-18atmel-samd: Swap out pulseio for touchio based on FreeTouch.Scott Shawcroft
2017-04-12atmel-samd: Rework status LED implementationScott Shawcroft
* Track status pin use by user code separately so it can take over the pins and then give them back. * Switch to hardware SPI for APA102 on Gemma and Trinket. * Merge microcontroller/types.h into microcontroller/Pin.h to better match approach going forwards.
2017-04-11atmel-samd: Reset PulseIn correctly on soft reset.Scott Shawcroft
2017-04-10Split up nativeio.0.9.4Scott Shawcroft
This was done to allow greatly granularity when deciding what functionality is built into each board's build. For example, this way pulseio can be omitted to allow for something else such as touchio.
2017-03-27atmel-samd: Add message for when auto reset is off. Fixes #112Scott Shawcroft
2017-03-10Add PulseOut which can pulse a PWMOut for IR remote transmission.Scott Shawcroft
2017-03-09atmel-samd: Turn on stack checking so infinite recursion doesn't completely ↵Scott Shawcroft
crash.
2017-02-27atmel-samd: Add USB HID mouse and keyboard support.Scott Shawcroft
2017-02-26atmel-samd: Use link time optimization to reduce code size of builds whichScott Shawcroft
share space with the file system. "Express" builds with SPI flash crash the compiler for some reason so its currently disabled for them.
2017-02-19atmel-samd: Stop calibrating the crystal for Gemma and Trinket. We need the ↵Scott Shawcroft
space for other code.
2017-02-10atmel-samd: Rework the clock configs to only be crystalless when needed by ↵Scott Shawcroft
the hardware.
2017-01-30Add frequency changing support to PWMOut.Scott Shawcroft
You can either set it once up front, or set variable_frequency on custruction to indicate that the frequency must be able to change. This informs whether a timer can be shared amongst pins. This also adds persistent clock calibration on atmel-samd. Once the device has synced its clock frequency over USB it will remember that config value until USB is used again. This helps ensure the clock frequency is similar on and off USB. Lastly, this also corrects time.sleep() when on USB by correcting the tick counter.
2017-01-19atmel-samd: stop overwriting the flash FS.Scott Shawcroft
2017-01-19atmel-samd: Change new flash FS name to CIRCUITPYScott Shawcroft
Fixes #79
2017-01-19atmel-samd: Reset the DAC on soft reset. Fixes #80.Scott Shawcroft
2017-01-19atmel-samd: Fully reset the ADC state on reset to prevent a crash.Scott Shawcroft
2017-01-13atmel-samd: Ensure pin state for first script run because we don't0.8.2Scott Shawcroft
know the post-bootloader state. Also, color the status LED purple for ValueErrors which are used to indicate a pin in use.
2017-01-12Fixup warnings from merge about undefined macro values, switch toScott Shawcroft
VM keyboard exception and switch to FATFS reader.
2016-12-20atmel-samd: Improve TouchIn to allow for multiple simultaneous touch pads.Scott Shawcroft
2016-12-19atmel-samd: Save space by not creating default files on the FS and by only ↵Scott Shawcroft
keeping LED flashing code when LEDs are present.
2016-12-13atmel-samd: Remove debug output.Scott Shawcroft
2016-12-12atmel-samd: Basic capacitive touch button support.Scott Shawcroft
Currently only works on a single channel and is only enabled for boards with SPI flash. Only really designed for hardware testing at this point.
2016-12-09atmel-samd: Add APA102 support and flash more advanced status.Scott Shawcroft
The new sequence is as follows: * Solid blue during the boot/settings script. * Solid green during the main/code script. * After main while waiting to enter repl or reset: * Fading green once main is done successfully. * On error produce a series of flashes: * Long flash color of script. * Long flash color of error: * Green = IndentationError * Cyan = SyntaxError * White = NameError * Orange = OSError * Yellow = Other error * Line number of the exception by digit. Number of flashes represents value. * Thousands = White * Hundreds = Blue * Tens = Yellow * Ones = Cyan * Off for a period and then repeats. At any point a write to the flash storage will flicker red. Fixes #63
2016-12-07atmel-samd: Stop dumping gc info on collect.Scott Shawcroft
Fixes #27.
2016-12-07atmel-samd & esp8266: Make sure pins are not already in use.Scott Shawcroft
This prevents corrupting previous functional objects by stealing their pins out from under them. It prevents this by ensuring that pins are in default state before claiming them. It also verifies pins are released correctly and reset on soft reset. Fixes #4, instantiating a second class will fail. Fixes #29, pins are now reset too.