Skip to content

Commit ca1a9b9

Browse files
authored
Merge pull request #369 from tannewt/nrf2_merge
Nrf52 merge
2 parents c966976 + b31d673 commit ca1a9b9

File tree

1,635 files changed

+66817
-444334
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,635 files changed

+66817
-444334
lines changed

.gitattributes

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,13 @@
1515
# These should also not be modified by git.
1616
tests/basics/string_cr_conversion.py -text
1717
tests/basics/string_crlf_conversion.py -text
18-
stmhal/pybcdc.inf_template -text
19-
stmhal/usbd_* -text
20-
stmhal/boards/*/stm32f4xx_hal_conf.h -text
21-
stmhal/cmsis/** -text
22-
stmhal/hal/** -text
23-
stmhal/usbdev/** -text
24-
stmhal/usbhost/** -text
25-
cc3200/hal/aes.c -text
26-
cc3200/hal/aes.h -text
27-
cc3200/hal/des.c -text
28-
cc3200/hal/i2s.c -text
29-
cc3200/hal/i2s.h -text
30-
cc3200/version.h -text
18+
ports/stm32/pybcdc.inf_template -text
19+
ports/stm32/usbd_* -text
20+
ports/stm32/usbdev/** -text
21+
ports/stm32/usbhost/** -text
22+
ports/cc3200/hal/aes.c -text
23+
ports/cc3200/hal/aes.h -text
24+
ports/cc3200/hal/des.c -text
25+
ports/cc3200/hal/i2s.c -text
26+
ports/cc3200/hal/i2s.h -text
27+
ports/cc3200/version.h -text

.gitmodules

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,12 @@
1111
[submodule "lib/berkeley-db-1.xx"]
1212
path = lib/berkeley-db-1.xx
1313
url = https://github.com/pfalcon/berkeley-db-1.xx
14-
[submodule "freetouch2"]
15-
path = atmel-samd/freetouch
16-
url = https://github.com/adafruit/Adafruit_FreeTouch.git
1714
[submodule "tools/uf2"]
1815
path = tools/uf2
1916
url = https://github.com/Microsoft/uf2.git
2017
[submodule "atmel-samd/frozen/Adafruit_CircuitPython_NeoPixel"]
2118
path = frozen/Adafruit_CircuitPython_NeoPixel
2219
url = https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel
23-
[submodule "atmel-samd/asf4"]
24-
path = atmel-samd/asf4
25-
url = https://github.com/adafruit/asf4.git
26-
branch = circuitpython
2720
[submodule "frozen/Adafruit_CircuitPython_Thermistor"]
2821
path = frozen/Adafruit_CircuitPython_Thermistor
2922
url = https://github.com/adafruit/Adafruit_CircuitPython_Thermistor.git
@@ -33,3 +26,14 @@
3326
[submodule "frozen/Adafruit_CircuitPython_BusDevice"]
3427
path = frozen/Adafruit_CircuitPython_BusDevice
3528
url = https://github.com/adafruit/Adafruit_CircuitPython_BusDevice.git
29+
[submodule "lib/stm32lib"]
30+
path = lib/stm32lib
31+
url = https://github.com/micropython/stm32lib
32+
branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0
33+
[submodule "freetouch2"]
34+
path = ports/atmel-samd/freetouch
35+
url = https://github.com/adafruit/Adafruit_FreeTouch.git
36+
[submodule "atmel-samd/asf4"]
37+
path = ports/atmel-samd/asf4
38+
url = https://github.com/adafruit/asf4.git
39+
branch = circuitpython

.travis.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,41 +37,55 @@ before_script:
3737
- sudo apt-get install -y --force-yes gcc-arm-embedded
3838
# For teensy build
3939
- sudo apt-get install realpath
40-
# For coverage testing
41-
# cpp-coveralls 0.4 conflicts with urllib3 preinstalled in Travis VM
42-
- sudo pip install cpp-coveralls==0.3.12
40+
# For coverage testing (upgrade is used to get latest urllib3 version)
41+
- sudo pip install --upgrade cpp-coveralls
4342
- gcc --version
4443
- arm-none-eabi-gcc --version
4544
- python3 --version
4645

4746
script:
4847
# Build mpy-cross first because other builds depend on it.
48+
- echo 'Building mpy-cross' && echo -en 'travis_fold:start:mpy-cross\\r'
4949
- make -C mpy-cross
50+
- echo -en 'travis_fold:end:mpy-cross\\r'
51+
- echo 'Building Adafruit binaries' && echo -en 'travis_fold:start:adafruit-bins\\r'
5052
- tools/build_adafruit_bins.sh
51-
- make -C minimal CROSS=1 build/firmware.bin
52-
- ls -l minimal/build/firmware.bin
53-
- mkdir -p ${HOME}/persist
53+
- echo -en 'travis_fold:end:adafruit-bins\\r'
54+
- make -C ports/minimal CROSS=1 build/firmware.bin
55+
- ls -l ports/minimal/build/firmware.bin
56+
#- mkdir -p ${HOME}/persist
5457
# Save new firmware for reference, but only if building a main branch, not a pull request
55-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp minimal/build/firmware.bin ${HOME}/persist/; fi'
56-
- make -C unix deplibs
57-
- make -C unix
58-
- make -C bare-arm
59-
- make -C qemu-arm test
58+
#- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cp ports/minimal/build/firmware.bin ${HOME}/persist/; fi'
59+
- echo 'Building unix' && echo -en 'travis_fold:start:unix\\r'
60+
- make -C ports/unix deplibs
61+
- make -C ports/unix
62+
- make -C ports/unix coverage
63+
- echo -en 'travis_fold:end:unix\\r'
64+
- echo 'Building qemu' && echo -en 'travis_fold:start:qemu\\r'
65+
- make -C ports/qemu-arm test
66+
- echo -en 'travis_fold:end:qemu\\r'
6067

6168
# run tests without coverage info
6269
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests)
6370
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests --emit native)
6471

6572
# run tests with coverage info
66-
- make -C unix coverage
67-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests)
68-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests -d thread)
69-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --emit native)
70-
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --via-mpy -d basics float)
73+
- echo 'Test all' && echo -en 'travis_fold:start:test_all\\r'
74+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests)
75+
- echo -en 'travis_fold:end:test_all\\r'
76+
- echo 'Test threads' && echo -en 'travis_fold:start:test_threads\\r'
77+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -d thread)
78+
- echo -en 'travis_fold:end:test_threads\\r'
79+
- echo 'Testing with native' && echo -en 'travis_fold:start:test_native\\r'
80+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --emit native)
81+
- echo -en 'travis_fold:end:test_native\\r'
82+
- echo 'Testing with mpy' && echo -en 'travis_fold:start:test_mpy\\r'
83+
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests --via-mpy -d basics float)
84+
- echo -en 'travis_fold:end:test_mpy\\r'
7185

7286
# run coveralls coverage analysis (try to, even if some builds/tests failed)
73-
#- (cd unix && coveralls --root .. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
87+
#- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
7488

7589
after_failure:
7690
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
77-
- (grep "FAIL" qemu-arm/build/console.out)
91+
- (grep "FAIL" ports/qemu-arm/build/console.out)

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,24 +177,24 @@ CircuitPython:
177177
Ports include the code unique to a microcontroller line and also
178178
variations based on the board.
179179

180-
* `atmel-samd` Support for SAMD21 based boards such as [Arduino Zero][],
180+
* `ports/atmel-samd` Support for SAMD21 based boards such as [Arduino Zero][],
181181
[Adafruit Feather M0 Basic][], and [Adafruit Feather M0 Bluefruit LE][].
182-
* `bare-arm` A bare minimum version of MicroPython for ARM MCUs.
183-
* `cc3200` Support for boards based [CC3200](http://www.ti.com/product/CC3200)
182+
* `ports/bare-arm` A bare minimum version of MicroPython for ARM MCUs.
183+
* `ports/cc3200` Support for boards based [CC3200](http://www.ti.com/product/CC3200)
184184
from TI such as the [WiPy 1.0](https://www.pycom.io/solutions/py-boards/wipy1/).
185-
* `esp8266` Support for boards based on ESP8266 WiFi modules such as the
185+
* `ports/esp8266` Support for boards based on ESP8266 WiFi modules such as the
186186
[Adafruit Feather HUZZAH][].
187-
* `minimal` A minimal MicroPython port. Start with this if you want
187+
* `ports/minimal` A minimal MicroPython port. Start with this if you want
188188
to port MicroPython to another microcontroller.
189-
* `pic16bit` Support for 16-bit PIC microcontrollers.
190-
* `qemu-arm` Support for ARM emulation through [QEMU](https://qemu.org).
191-
* `stmhal` Support for boards based on STM32 microcontrollers including
189+
* `ports/pic16bit` Support for 16-bit PIC microcontrollers.
190+
* `ports/qemu-arm` Support for ARM emulation through [QEMU](https://qemu.org).
191+
* `ports/stm32` Support for boards based on STM32 microcontrollers including
192192
the MicroPython flagship [PyBoard](https://store.micropython.org/store/#/products/PYBv1_1).
193-
* `teensy` Support for the Teensy line of boards such as the
193+
* `ports/teensy` Support for the Teensy line of boards such as the
194194
[Teensy 3.1](https://www.pjrc.com/teensy/teensy31.html).
195-
* `unix` Support for UNIX.
196-
* `windows` Support for [Windows](https://www.microsoft.com/en-us/windows/).
197-
* `zephyr` Support for [Zephyr](https://www.zephyrproject.org/), a
195+
* `ports/unix` Support for UNIX.
196+
* `ports/windows` Support for [Windows](https://www.microsoft.com/en-us/windows/).
197+
* `ports/zephyr` Support for [Zephyr](https://www.zephyrproject.org/), a
198198
real-time operating system by the Linux Foundation.
199199

200200
CircuitPython only maintains the `atmel-samd` and `esp8266` ports. The

atmel-samd/freetouch

Lines changed: 0 additions & 1 deletion
This file was deleted.

atmel-samd/tools/bossac.exe

-646 KB
Binary file not shown.

cc3200/misc/mpexception.c

Lines changed: 0 additions & 91 deletions
This file was deleted.

docs/esp8266/tutorial/neopixel.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ To set the colour of pixels use::
2020
>>> np[1] = (0, 128, 0) # set to green, half brightness
2121
>>> np[2] = (0, 0, 64) # set to blue, quarter brightness
2222

23+
For LEDs with more than 3 colours, such as RGBW pixels or RGBY pixels, the
24+
NeoPixel class takes a ``bpp`` parameter. To setup a NeoPixel object for an
25+
RGBW Pixel, do the following::
26+
27+
>>> import machine, neopixel
28+
>>> np = neopixel.NeoPixel(machine.Pin(4), 8, bpp=4)
29+
30+
In a 4-bpp mode, remember to use 4-tuples instead of 3-tuples to set the colour.
31+
For example to set the first three pixels use::
32+
33+
>>> np[0] = (255, 0, 0, 128) # Orange in an RGBY Setup
34+
>>> np[1] = (0, 255, 0, 128) # Yellow-green in an RGBY Setup
35+
>>> np[2] = (0, 0, 255, 128) # Green-blue in an RGBY Setup
36+
2337
Then use the ``write()`` method to output the colours to the LEDs::
2438

2539
>>> np.write()

docs/library/btree.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,24 @@ Example::
7676
Functions
7777
---------
7878

79-
.. function:: open(stream, \*, flags=0, cachesize=0, pagesize=0, minkeypage=0)
79+
.. function:: open(stream, \*, flags=0, pagesize=0, cachesize=0, minkeypage=0)
8080

8181
Open a database from a random-access `stream` (like an open file). All
8282
other parameters are optional and keyword-only, and allow to tweak advanced
8383
parameters of the database operation (most users will not need them):
8484

8585
* *flags* - Currently unused.
86-
* *cachesize* - Suggested maximum memory cache size in bytes. For a
87-
board with enough memory using larger values may improve performance.
88-
The value is only a recommendation, the module may use more memory if
89-
values set too low.
9086
* *pagesize* - Page size used for the nodes in BTree. Acceptable range
91-
is 512-65536. If 0, underlying I/O block size will be used (the best
92-
compromise between memory usage and performance).
87+
is 512-65536. If 0, a port-specific default will be used, optimized for
88+
port's memory usage and/or performance.
89+
* *cachesize* - Suggested memory cache size in bytes. For a
90+
board with enough memory using larger values may improve performance.
91+
Cache policy is as follows: entire cache is not allocated at once;
92+
instead, accessing a new page in database will allocate a memory buffer
93+
for it, until value specified by *cachesize* is reached. Then, these
94+
buffers will be managed using LRU (least recently used) policy. More
95+
buffers may still be allocated if needed (e.g., if a database contains
96+
big keys and/or values). Allocated cache buffers aren't reclaimed.
9397
* *minkeypage* - Minimum number of keys to store per page. Default value
9498
of 0 equivalent to 2.
9599

docs/library/framebuf.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ Constructors
3838
- *width* is the width of the FrameBuffer in pixels
3939
- *height* is the height of the FrameBuffer in pixels
4040
- *format* specifies the type of pixel used in the FrameBuffer;
41-
valid values are ``framebuf.MVLSB``, ``framebuf.RGB565``
42-
and ``framebuf.GS4_HMSB``. MVLSB is monochrome 1-bit color,
43-
RGB565 is RGB 16-bit color, and GS4_HMSB is grayscale 4-bit color.
41+
permissible values are listed under Constants below. These set the
42+
number of bits used to encode a color value and the layout of these
43+
bits in *buffer*.
4444
Where a color value c is passed to a method, c is a small integer
4545
with an encoding that is dependent on the format of the FrameBuffer.
4646
- *stride* is the number of pixels between each horizontal line
@@ -110,8 +110,9 @@ Other methods
110110
corresponding color will be considered transparent: all pixels with that
111111
color value will not be drawn.
112112

113-
This method works between FrameBuffer's utilising different formats, but the
114-
resulting colors may be unexpected due to the mismatch in color formats.
113+
This method works between FrameBuffer instances utilising different formats,
114+
but the resulting colors may be unexpected due to the mismatch in color
115+
formats.
115116

116117
Constants
117118
---------

0 commit comments

Comments
 (0)