Commit Graph

261 Commits

Author SHA1 Message Date
Dan Halbert
4c55dc2445
Merge pull request #8096 from jepler/lto-parallel
Speed LTO builds by using multiple threads
2023-06-20 13:32:47 -04:00
Jeff Epler
cae02f1cdf
Speed LTO builds by using multiple threads
On my i5-1235U laptop this speeds LTO "partition=balanced" builds
substantially, because each "partition" can be run on a separate
CPU thread. I used "pygamer" as my test build with a parallelism of
`-j4`, and took the best elapsed time reported over 4 builds.

The improvement was from 34.6s to 24.0s (-30%).

A link-only build (rm build-pygamer/firmware.elf; make -j...) improved
from1 17.4s to 5.1s (-70%)

The size of the resulting firmware is unchanged.

Boards that are nearly full use "-flto-partition=one" to improve code
size optimization. When LTO partition is "one", this feature doesn't help
but it doesn't seem to negatively affect anything either (tested
building trinket_m0)
2023-06-20 11:01:46 -05:00
Jeff Epler
c408193ffe
Merge pull request #8048 from jepler/synthio-biquad
Synthio: switch to per-note biquad filtering
2023-06-07 14:48:31 -05:00
Dan Halbert
46c5be07ff remove debugging print 2023-06-06 11:04:27 -04:00
Dan Halbert
b576ec21b3 add tools to common submodules to fetch 2023-06-05 19:04:32 -04:00
Dan Halbert
a7da1c4ad4 fix ports path arg to fetch-submodules.sh 2023-06-05 19:01:51 -04:00
Dan Halbert
38f6fa27e3 fetch-port-submodules; fetch-all-submodules 2023-06-05 17:23:34 -04:00
Jeff Epler
fed8d5825b
synthio: add biquad filter type & basic filter calculations
the filter cannot be applied as yet.
2023-05-29 09:50:18 -05:00
Jeff Epler
391438102b
synthio: Finish implementing Math blocks 2023-05-17 16:32:20 -05:00
Jeff Epler
f83212314e
synthio: Add LFOs 2023-05-15 21:15:39 -05:00
Jeff Epler
a7da245ad0
synthio: Add synthio.Note
This class allows much more expressive sound synthesis:
 * tremolo & vibrato
 * arbitrary frequency
 * different evelope & waveform per note
 * all properties dynamically settable from Python code
2023-05-04 07:23:49 -05:00
Scott Shawcroft
66edcf5d03
Add PicoDVI support
PicoDVI in CP support 640x480 and 800x480 on Feather DVI, Pico and
Pico W. 1 and 2 bit grayscale are full resolution. 8 and 16 bit
color are half resolution.

Memory layout is modified to give the top most 4k of ram to the
second core. Its MPU is used to prevent flash access after startup.

The port saved word is moved to a watchdog scratch register so that
it doesn't get overwritten by other things in RAM.

Right align status bar and scroll area. This normally gives a few
pixels of padding on the left hand side and improves the odds it is
readable in a case. Fixes #7562

Fixes c stack checking. The length was correct but the top was being
set to the current stack pointer instead of the correct top.
Fixes #7643

This makes Bitmap subscr raise IndexError instead of ValueError
when the index arguments are wrong.
2023-04-19 15:14:02 -07:00
Jeff Epler
b011468251
Add synthio.Synthesizer
In contrast to MidiTrack, this can be controlled from Python code,
turning notes on/off as desired.

Not tested on real HW yet, just the acceptance test based on checking
which notes it thinks are held internally.
2023-04-02 20:37:23 -05:00
MicroDev
ccd417cd8b
add esp specific modules to src patterns 2023-03-21 16:01:13 +05:30
Scott Shawcroft
a8b34bd067
Merge pull request #7549 from gamblor21/gif_displayio_support
Animated GIF support
2023-02-21 11:39:29 -08:00
Dan Halbert
d46d9d5c21 shorten safe mode messages; improve message printing; fix CIRCUITPY_SAFEMODE_PY=0 2023-02-13 21:29:57 -05:00
Dan Halbert
d8231f1588 Implement safemode.py 2023-02-13 18:26:38 -05:00
gamblor21
0c95e6a08e Moving to gifio module 2023-02-12 11:17:34 -06:00
gamblor21
da9b6fb0e2 Moving library to /lib 2023-02-10 18:31:59 -06:00
gamblor21
6a9b7199ec Initial gif proof of concept 2023-02-04 16:44:29 -06:00
Scott Shawcroft
f8ac1d9261
Rework the coproc API
It is now a generic `memorymap` API and an ESP specific `espulp` module.

Fixes #7218. Fixes #3234. Fixes #7300.
2022-12-19 14:08:38 -05:00
Jeff Epler
5ac622a30d
get rid of nearly-empty getenv.c file 2022-12-13 13:13:01 -06:00
Jeff Epler
cc7d550407
Really finish renaming to getenv 2022-12-09 14:28:46 -06:00
Jeff Epler
3459fe322b
Withdraw the _environ module
This existed solely for testing, so expose it a different way during
the unix coverage build

Also turn off os.getenv support on samd21.
2022-12-08 15:33:10 -06:00
Jeff Epler
ef2bfdb5db
dotenv becomes settings.toml 2022-12-08 12:44:20 -06:00
foamyguy
57d7f7f2ad move to _pixelmap 2022-11-24 09:07:08 -06:00
Jeff Epler
f5c637dc10
Add adafruit_pixelmap.PixelMap
.. a fast helper for animations. It is similar to and inspired by the
PixelMap helper in Adafruit LED Animation library, but with an extremely
fast 'paste' method for setting a series of pixels. This is a common
operation for many animations, and can give a substantial speed improvement.

It's named `adafruit_pixelmap` so that we can package a compatible version
in pure Python for systems that can't fit it in C in flash, or for
Blinka.

This is a proof of concept and can make a very fast comet animation:
```python
import time
import adafruit_pixelbuf
import adafruti_pixelmap
import board
import neopixel
from supervisor import ticks_ms
from adafruit_led_animation.animation.solid import Solid
from adafruit_led_animation import color

pixel_pin = board.GP0
pixel_num = 96

pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness=1, auto_write=False, pixel_order="RGB")

evens = adafruit_pixelmap.PixelMap(pixels, tuple(range(0, pixel_num, 2)))
odd_indices = tuple((i, i+2) for i in range(1, pixel_num, 4))
print(odd_indices)
odds = adafruit_pixelbuf.PixelMap(pixels, odd_indices)
assert len(odds) == len(odd_indices)


comet_length = 16

comet1 = [color.calculate_intensity(color.GREEN, ((1+i) / comet_length) ** 2.4)
        for i in range(comet_length)]
comet2 = [color.calculate_intensity(color.PURPLE, ((1+i) / comet_length) ** 2.4)
        for i in range(comet_length)]

pos1 = 0
pos2 = 96//4

while True:
    evens.paste(comet1, pos1, wrap=True, reverse=False, others=0)
    pos1 = (pos1 + 1) % len(evens)

    odds.paste(comet2, pos2, wrap=True, reverse=True, others=0)
    pos2 = (pos2 - 1) % len(odds)
    pixels.show()

    m = ticks_ms()
    if m % 2000 > 1000:
        time.sleep(.02)
```
2022-11-11 07:54:33 -06:00
microDev
b33a2b45dc
add coproc alarm 2022-10-20 18:38:20 +05:30
microDev
5232e3f6c3
add coproc module 2022-10-20 09:09:44 +05:30
Jeff Epler
346fff2e7c
cyw43 basic gpio support, hwaddr in boot_out 2022-09-28 10:06:33 -05:00
Dan Halbert
6bb47038d5 Merge remote-tracking branch 'adafruit/main' into adcdma 2022-09-15 20:42:51 -04:00
Jeff Epler
56112e00a1 Give fontio its own enable
.. the default is intended to be the equivalent of the original,
implementing `DISPLAYIO && TERMINALIO`.

This is a possible alternative to #6889, if I understand the intent.
2022-09-11 08:09:14 -05:00
Lee Atkinson
f279a2dbb2
Merge branch 'adafruit:main' into adcdma 2022-09-08 11:46:01 -04:00
latkinso42
a1856ea3e9 Renaming module from adcbuffer to analogbufio 2022-09-05 12:11:49 -04:00
Dan Halbert
52080e24eb status bar control 2022-08-30 15:23:44 -04:00
Lee Atkinson
6fd08483e2 Tidying code for PR/ Minor Issues 2022-08-24 17:41:51 -04:00
Lee Atkinson
61591ac136 adding __init.c to circuitpy_defs.mk 2022-08-19 13:17:37 -04:00
Lee Atkinson
d3c3c9eac4 Tidy a few things 2022-08-18 19:10:16 -04:00
Lee Atkinson
f91af513b7 Introduced odule adcbuffer / removed analogio/AnalogFastIn 2022-08-18 16:23:17 -04:00
Lee Atkinson
b2c6bcdf6d Fixing py/circuitpy_defns.mk 2022-08-14 14:22:22 -04:00
Lee Atkinson
4542c801b0 Tidying up loose endson draft PR 2022-08-14 13:03:33 -04:00
Lee Atkinson
e778112710
Merge branch 'adafruit:main' into adcdma 2022-08-10 10:29:17 -04:00
Lee Atkinson
9e0c580d3d AnalogFastIn 2022-08-10 09:42:24 -04:00
Dan Halbert
84807cd6eb Change I2C terminology from "peripheral" to "target" 2022-08-09 13:13:19 -04:00
Scott Shawcroft
7589e53fea
WIP websocket accept and hashlib 2022-07-01 10:18:33 -07:00
Scott Shawcroft
6446010753
Wi-Fi autoconnect and title bar status
This adds support for CIRCUITPY_WIFI_SSID and CIRCUITPY_WIFI_PASSWORD
in `/.env`. When both are defined, CircuitPython will attempt to
connect to the network even when user code isn't running. If the
user code attempts to a network with the same SSID, it will return
immediately. Connecting to another SSID will disconnect from the
auto-connected network. If the user code initiates the connection,
then it will be shutdown after user code exits. (Should match <8
behavior.)

This PR also reworks the default displayio terminal. It now supports
a title bar TileGrid in addition to the (newly renamed) scroll area.
The default title bar is the top row of the display and is positioned
to the right of the Blinka logo when it is enabled. The scroll area
is now below the Blinka logo.

The Wi-Fi auto-connect code now uses the title bar to show its
state including the IP address when connected. It does this through
the "standard" OSC control sequence `ESC ] 0 ; <s> ESC \` where <s>
is the title bar string. This is commonly supported by terminals
so it should work over USB and UART as well.

Related to #6174
2022-06-09 14:55:54 -07:00
Scott Shawcroft
09c61efcff
Split partition from LTO enable 2022-06-01 11:12:14 -07:00
Scott Shawcroft
7fc0aa5791
Fix windows and two samd builds 2022-05-31 14:48:41 -07:00
Scott Shawcroft
4d776339ad
Separate translate object control from LTO 2022-05-31 12:42:59 -07:00
Scott Shawcroft
9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00