summaryrefslogtreecommitdiff
path: root/main.c
AgeCommit message (Collapse)Author
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
2018-06-05main: Explicitly set the stack top based on _estackJeff Epler
.. setting it based on the ad-hoc stack pointer calculation of mp_stack_ctrl_init() meant that the stack used above main() counts against the 1KiB safety factor that the mp_stack_set_limit call tries to establish. It turns out, at least on M4, that over half of the safety factor is used up by stack-above-main()! In the case of the basics/gen_stack_overflow.py test, which blows the stack on purpose, it turns out that gc would be called while handling the "maximum recursion depth exceeded" error, and this needed more stack than was left. Closes: #900
2018-05-19wasn't always clearing boot_output_fileDan Halbert
2018-05-14Rename reload_next_character to reload_requested to make it match it's ↵Roy Hooper
intended use
2018-05-07clarify commentDan Halbert
2018-05-06boot.py change of filesystem writability would get overridden.Dan Halbert
2018-05-04minor function API improvementDan Halbert
2018-05-03Handle bad power on reset.Dan Halbert
2018-04-12Fix the status neopixel flashing.Scott Shawcroft
We were storing the wrong current color.
2018-04-09add storage.erase_filesystem() to erase and reformat CIRCUITPYDan Halbert
2018-03-24WIP: simple working HIDDan Halbert
2018-02-14m4 pulseout worksScott Shawcroft
2018-02-12m4 tc output works. Watch out for the PAC!Scott Shawcroft
2017-11-22M4 status LED flashing with no main.py present #447 Initialized stack variablemrmcwethy
2017-11-16Create supervisor module.Scott Shawcroft
It can control autoreload and the rgb status led.
2017-11-07support for doubled file extensions ala issue #383 (#415)bsiepert
Fixes #383
2017-10-31atmel-samd: Add samd21 neopixel support.Scott Shawcroft
Also, fix and enable the status neopixel. Fixes #264
2017-10-30atmel-samd: More USB polishScott Shawcroft
* Introduce a python script to generate the USB descriptor instead of a bunch of C macros. In the future, we can use this dynamically in CircuitPython. * Add support for detecting read-only mass storage mounts. Fixes #377
2017-10-27Read serial input as a background task so we can check for the interrupt ↵Dan Halbert
character.
2017-10-27Revert "Allow main.py to be interrupted by ctrl-C" (#381)Dan Halbert
* Revert "Read serial input as a background task so we can check for the interrupt character." This reverts commit 046092e8a29822ae5d761fbaac1a3af181b1297c. * Revert "Check INTERNAL_LIBM make flag in a safer way." This reverts commit 2b80add22f5d22544d8362c19d4332a489325ac9.
2017-10-27Read serial input as a background task so we can check for the interrupt ↵Dan Halbert
character.
2017-10-12merge 2.x changes into master; touch up Makefile CFLAGS logicDan Halbert
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.