Commit Graph

10197 Commits

Author SHA1 Message Date
Dan Halbert
efbf08266b make _estack be double-word aligned 2018-01-24 19:24:36 -05:00
Dan Halbert
302ad40fb2 Revert "alloca seems buggy on M4"
This reverts commit 4b1e9d8f92.
2018-01-24 19:24:36 -05:00
Dan Halbert
5de29acbd2
Merge pull request #547 from tannewt/alloc_long_lived
Introduce a long lived section of the heap.
2018-01-24 16:21:38 -08:00
Scott Shawcroft
aa0ce98b3e Fix the initial state and polish a couple comments. 2018-01-24 14:13:26 -08:00
Scott Shawcroft
da330f0cab Polish up the heap analysis script and make it more CLI friendly.
It can now render the heap layout over a sequence of ram dumps.

The mpy analysis is also better at parsing mpy files.
2018-01-24 10:33:46 -08:00
Scott Shawcroft
416abe33ed Introduce a long lived section of the heap.
This adapts the allocation process to start from either end of the heap
when searching for free space. The default behavior is identical to the
existing behavior where it starts with the lowest block and looks higher.
Now it can also look from the highest block and lower depending on the
long_lived parameter to gc_alloc. As the heap fills, the two sections may
overlap. When they overlap, a collect may be triggered in order to keep
the long lived section compact. However, free space is always eligable
for each type of allocation.

By starting from either of the end of the heap we have ability to separate
short lived objects from long lived ones. This separation reduces heap
fragmentation because long lived objects are easy to densely pack.

Most objects are short lived initially but may be made long lived when
they are referenced by a type or module. This involves copying the
memory and then letting the collect phase free the old portion.

QSTR pools and chunks are always long lived because they are never freed.

The reallocation, collection and free processes are largely unchanged. They
simply also maintain an index to the highest free block as well as the lowest.
These indices are used to speed up the allocation search until the next collect.

In practice, this change may slightly slow down import statements with the
benefit that memory is much less fragmented afterwards. For example, a test
import into a 20k heap that leaves ~6k free previously had the largest
continuous free space of ~400 bytes. After this change, the largest continuous
free space is over 3400 bytes.
2018-01-24 10:33:46 -08:00
Scott Shawcroft
a5bfbbc12a
Merge pull request #548 from dhalbert/3.0_alloca_problem_issue_521
alloca seems buggy on M4
2018-01-24 09:04:31 -08:00
Dan Halbert
1e94c4240c undo removal of alloca in builtinimport.c 2018-01-23 23:47:44 -05:00
Dan Halbert
4b1e9d8f92 alloca seems buggy on M4 2018-01-23 20:54:02 -05:00
Scott Shawcroft
56bd0789af Speed up qstr loading by using the stack to store a temporary
string instead of the heap.
2018-01-23 16:45:22 -08:00
Scott Shawcroft
6560596864 Switch to m_malloc_maybe and m_free to reduce our dependence on gc_alloc.
gc_alloc's API is changing and we shouldn't need to care about it.
So, we switch to m_malloc which has the default behavior we expect.
2018-01-23 16:45:07 -08:00
sommersoft
fe851fc15e re-added header inlcusion for system_get_chip_id 2018-01-23 13:50:24 -08:00
brentrubell
ab1f133667 issue #536 CPX change SPI pin designations to externally available pins (#540)
* issue #536 CPX

* switched pin assignment
2018-01-22 19:31:55 -08:00
Dan Halbert
544b9e4ba0
Merge pull request #541 from ladyada/itsybitsy_m0_fixes
Itsybitsy m0 fixes
2018-01-19 20:24:17 -08:00
ladyada
6b66c3b7a3 Add W25Q16 USON flash support, alternative flash type support for all boards 2018-01-19 23:00:04 -05:00
Tony DiCola
3b946f667e Add missing Feather M0 RadioFruit boards: RFM69, RFM9x. (#538) 2018-01-19 11:55:39 -08:00
Tony DiCola
4bd1d09d74 Add missing Feather M0 RadioFruit boards: RFM69, RFM9x (#539) 2018-01-19 11:53:47 -08:00
Scott Shawcroft
d16af1fbb2 Heap analysis tool (#529)
* random heap stuff

* Fix dicts

* Less hand coding. Now reads .map file for memory locations of stuff.

* Display qstr chunk contents.
2018-01-18 18:53:52 -08:00
sommersoft
44bc1711aa Added Unique ID Functions/Updated Support Matrix (#527)
shared_bindings/index.rst: updated Support Matrix format as discussed in PR #503 & Issue #448.

shared-bindings/microcontroller/Processor.c & .h: added UID lookup functionality for use with all ports. Fixes #462.
2018-01-18 11:39:11 -08:00
hathach
dfa6b6e9c5 add Ctrl+C for REPL over bleuart 2018-01-18 11:32:47 -08:00
Kevin Townsend
17ff1b2b46 Fixed build folder for travis 2018-01-18 11:32:47 -08:00
Kevin Townsend
d5af898999 Added note on REPL over NUS 2018-01-18 11:32:47 -08:00
hathach
5e6f113779 add REPL via bleuart 2018-01-18 11:32:47 -08:00
microbuilder
fda065ea89 Minor scan example cleanup 2018-01-18 11:32:47 -08:00
microbuilder
e2ebcbe514 Simple BLE scanner example 2018-01-18 11:32:47 -08:00
microbuilder
1276c12097 Enable SD132v2.0.1 BLE and UBLUEPY support by default 2018-01-18 11:32:47 -08:00
Dan Halbert
23eb79ca8f turn on MICROPY_ENABLE_SOURCE_LINE in nrf 2018-01-16 18:11:54 -08:00
Dan Halbert
01443a9619 Make chosen features consistent across all boards and ports atmel-samd, esp8266, and nrf.
1. Turn off MICROPY_CPYTHON_COMPAT, which includes a number of minor CPython compatibility features,
most of which have workarounds, but uses up significant flash.
2. Turn on MICROPY_PY_SYS_MAXSIZE, which implements sys.maxsize.
3. Turn on MICROPY_CAN_OVERRIDE_BUILTINS, which implements "_" as the most recent value in the REPL,
and also enables redefining builtins.
2018-01-16 18:11:54 -08:00
Radomir Dopieralski
8251abba8a
Merge pull request #520 from pewpew-game/2.x
Fix example for gamepad
2018-01-11 18:44:50 +01:00
Radomir Dopieralski
0ff128ec03 Fix example for gamepad
The example code for the gamepad module would skip detected
button presses in the code that waits for a button to be released,
because it would run it even when no button is pressed.

Also updated the example pin names to not use RX and TX.
2018-01-11 17:06:53 +01:00
Scott Shawcroft
d201ac20af Fix sensor table. (#517)
RST is very picky about spacing.
2018-01-08 20:38:43 -05:00
Dan Halbert
2d5483082d Checked wrong RCAUSE bit for system_reset 2018-01-08 15:45:07 -08:00
Dan Halbert
1805bcac76 enable use of CIRCUITPY_CANARY_WORD (needed for 2.2 merge) (#513)
enable use of CIRCUITPY_CANARY_WORD (needed for 2.2 merge)

RCAUSE (reset cause) is fetched differently in SAMD21 vs SAMD51
2018-01-08 09:44:06 -08:00
Dan Halbert
b1b89c409e
Merge pull request #512 from tannewt/gcc7
Switch to GCC7. The ARM release from Q4.
2018-01-05 17:41:50 -05:00
Scott Shawcroft
7e390886fb Switch to GCC7. The ARM release from Q4. 2018-01-04 21:36:50 -08:00
Dan Halbert
5cb361cf1f
Merge pull request #510 from dhalbert/3.0_merge_2.2.0
merge from 2.2.0 + fix up board defs
2018-01-04 20:59:59 -05:00
Dan Halbert
d0cc8abd31 revise boards/ files for 3.0. All now compiled (but I don't have all to test). 2018-01-04 14:16:53 -05:00
Dan Halbert
19d353ccd9 nrf: fixups for changes from 2.2
1. bidirectional SPI support (@microbuilder please check)
2. slight changes in DigitalIO types
3. placeholders (not implemented yet) for single/double-click bootloader support
2018-01-03 16:50:57 -05:00
Dan Halbert
d8686cc002 use correct LD_FILE in mpconfigboard.mk for boards with external flash 2018-01-03 16:49:38 -05:00
Dan Conley
7d3bec46ae Changing magnetic attribute in design guide (#502) 2018-01-02 20:03:20 -08:00
Dan Halbert
065e82015f merge from 2.2.0 + fix up board defs 2018-01-02 21:25:41 -05:00
Dan Halbert
ce81c8dda9 Avoid gcc 7.2.1 compiler issues in nlr_push() (#506)
Avoid gcc 7.2.1 compiler issues in nlr_push()
2018-01-02 13:41:34 -08:00
Scott Shawcroft
3be456629b
Merge pull request #496 from microbuilder/nrf52_3.x
nRF52 update with internal file system support
2018-01-02 12:09:20 -08:00
Scott Shawcroft
a1a02c5427
Conditionally install build deps to speed up Travis 2018-01-02 11:54:11 -08:00
Dan Halbert
d9ae709045
Merge pull request #505 from dhalbert/2.2_update_cpx_frozen_libs
update CPX frozen modules to latest versions
2017-12-30 12:16:27 -05:00
Dan Halbert
9a50fa4a50 update CPX frozen modules to latest versions 2017-12-30 11:22:29 -05:00
Dan Halbert
18f3dfcd90
Merge pull request #503 from sommersoft/master
shared-bindings/index.rst: added audiobusio
2017-12-30 08:53:27 -05:00
sommersoft
881fa8e2b9 shared-bindings/index.rst: added audiobusio
shared-bindings/index.rst: added `aduiobusio` to Support Matrix. Used `audiobusio/_init_.c` to verify applicable ports; SAMD21 was the only one listed...ESP8266 wasn't. This fixes issue #448.
2017-12-30 01:36:23 -06:00
hathach
a997ab258e spacing clean up 2017-12-29 23:07:32 +07:00
hathach
6c8d60afc0 Merge branch 'nrf52_3.x' of github.com:microbuilder/circuitpython into nrf52_3.x 2017-12-29 22:44:40 +07:00