summaryrefslogtreecommitdiff
path: root/main.c
AgeCommit message (Collapse)Author
2020-01-29Move board_init to main.cLucian Copeland
2019-12-12merge from masterDan Halbert
2019-12-12Fix flash write error handling; clean up safe mode message printingDan Halbert
2019-12-05wipDan Halbert
2019-10-21Refine _bleioScott Shawcroft
This PR refines the _bleio API. It was originally motivated by the addition of a new CircuitPython service that enables reading and modifying files on the device. Moving the BLE lifecycle outside of the VM motivated a number of changes to remove heap allocations in some APIs. It also motivated unifying connection initiation to the Adapter class rather than the Central and Peripheral classes which have been removed. Adapter now handles the GAP portion of BLE including advertising, which has moved but is largely unchanged, and scanning, which has been enhanced to return an iterator of filtered results. Once a connection is created (either by us (aka Central) or a remote device (aka Peripheral)) it is represented by a new Connection class. This class knows the current connection state and can discover and instantiate remote Services along with their Characteristics and Descriptors. Relates to #586
2019-10-20Parameterize linker scriptDan Halbert
2019-10-18Use get top and limit stack functionsKamil Tomaszewski
2019-08-22Fix builds without displayioScott Shawcroft
2019-08-22Refresh ePaper displays once code.py is done runningScott Shawcroft
2019-07-24Requested changes, general cleanupHierophect
2019-07-22Fix LED misuse interfering with atmel buildsHierophect
2019-07-22Add feature conditionals and clean upHierophect
2019-06-28remove build, fix link issues)Hierophect
2019-06-28first commit, very crudeHierophect
2019-06-06Include display objects in gc.Dan Halbert
2019-04-17Unify VM cleanup codeScott Shawcroft
Before we were skipping reset of the standard busses after boot and repl which could lead to a crash in a subsequent VM run. Fixes #1806
2019-04-09Merge pull request #1773 from dhalbert/no-recursive-background-tasksScott Shawcroft
Don't let a background task call run_background_tasks()
2019-04-09Don't let a background task call run_background_tasks()Dan Halbert
2019-04-08Reorganize board busses into shared-bindings and shared-module.Scott Shawcroft
2019-03-16also flush fileystem on soft reboot from replDan Halbert
2019-03-16after code.py runs, flush filesystem before resetting heapDan Halbert
2019-03-12Enter safe mode when an allocation is attempted on an uninitialized heap.Scott Shawcroft
2019-02-21Add option to disable the concurrent write protectionScott Shawcroft
This allows writing to the filesystem from the host computer and CircuitPython by increasing the risk of filesystem corruption.
2019-02-19Prevent infinite display update recursion and fix VFS mountingScott Shawcroft
Fixes #1529
2019-02-15WIP: atmel-samd trinket build worksDan Halbert
2019-02-13A safe mode fix and displayio fixesScott Shawcroft
* Fixes safe mode on the SAMD51. The "preserved" value was being clobbered by the bootloader. * Fixes auto-reload loop when in safe mode. * Fixes reading Group children with []. * Check that a TileGrid actually moves before queueing a refresh.
2019-02-07Make several const char / const char * arrays static to save a bit of space.Lionel Debroux
Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
2019-01-31More improvements to Terminal:Scott Shawcroft
* Fix Hallowing. * Fix builds without displayio. * Fix y bounds that appears as untrollable row of pixels. * Add scrolling to TileGrid. * Remove Sprite to save space. TileGrid is a drop in replacement.
2019-01-31Support adjustable backlight brightnessScott Shawcroft
2019-01-31Hook up the terminal based on the first display.Scott Shawcroft
2019-01-17Fix up nrf and using board.SPI in FourWireScott Shawcroft
2019-01-17External fourwire works and blinka splash afterScott Shawcroft
2019-01-16Rework displays in prep for dynamic support and 8bit parallel.Scott Shawcroft
2018-12-07Fix running the USB task on nRF.Scott Shawcroft
It wasn't being run due to a rework done only on the atmel-samd port. The rework itself isn't needed now that the heap check triggers safe mode instead of throwing a Python exception. So, I've removed the rework.
2018-12-06Rework safe mode and have heap overwrite trigger it.Scott Shawcroft
This creates a common safe mode mechanic that ports can share. As a result, the nRF52 now has safe mode support as well. The common safe mode adds a 700ms delay at startup where a reset during that window will cause a reset into safe mode. This window is designated by a yellow status pixel and flashing the single led three times. A couple NeoPixel fixes are included for the nRF52 as well. Fixes #1034. Fixes #990. Fixes #615.
2018-12-04Add stack validity check and raise an error when it happens.Scott Shawcroft
The backtrace cannot be given because it relies on the validity of the qstr data structures on the heap which may have been corrupted. In fact, it still can crash hard when the bytecode itself is overwritten. To fix, we'd need a way to skip gathering the backtrace completely. This also increases the default stack size on M4s so it can accomodate the stack needed by ASF4s nvm API.
2018-11-15merge 3.x swap of /lib and .frozen; update frozen libsDan Halbert
2018-11-08Move atmel-samd to tinyusb and support nRF flash.Scott Shawcroft
This started while adding USB MIDI support (and descriptor support is in this change.) When seeing that I'd have to implement the MIDI class logic twice, once for atmel-samd and once for nrf, I decided to refactor the USB stack so its shared across ports. This has led to a number of changes that remove items from the ports folder and move them into supervisor. Furthermore, we had external SPI flash support for nrf pending so I factored out the connection between the usb stack and the flash API as well. This PR also includes the QSPI support for nRF.
2018-11-01put .frozen before /lib in sys.path; update frozen librariesDan Halbert
2018-10-11network module c api into shared-moduleNick Moore
2018-10-04change initialization method + mod_network namesNick Moore
2018-09-06Initial Grand Central definitionScott Shawcroft
It has a ton of pins in a Mega form-factor This also includes a change to init the stack earlier. It fixes a crash that occurs if the flash doesn't start correctly and the original spot isn't reached.
2018-08-31add pin claiming to devicesDan Halbert
2018-08-16Compress all translated strings with Huffman coding.Scott Shawcroft
This saves code space in builds which use link-time optimization. The optimization drops the untranslated strings and replaces them with a compressed_string_t struct. It can then be decompressed to a c string. Builds without LTO work as well but include both untranslated strings and compressed strings. This work could be expanded to include QSTRs and loaded strings if a compress method is added to C. Its tracked in #531.
2018-08-07Support internationalisation.Scott Shawcroft
2018-07-31Allow for resizing the stack area.Scott Shawcroft
2018-07-31Add basic memory allocation outside Python runtimeScott Shawcroft
This allows for the heap to fill all space but the stack. It also allows us to designate space for memory outside the runtime for things such as USB descriptors, flash cache and main filename. Fixes #754
2018-07-03Mark pointers in cpu registers as in use.Scott Shawcroft
This prevents bugs where gc_collect is called from C code that did a recent allocation.
2018-06-14Fix playing audio from SD cardDan Halbert
2018-06-06main: move code pertaining to boot.py out of lineJeff Epler
.. this reduces stack usage in main() substantially, because the 512 byte stack allocation will only exist during the new run_boot_py function's duration. Closes: #904