Commit Graph

349 Commits

Author SHA1 Message Date
Dan Halbert
bed6d43a76 merge from upstream; WIP redo Address; no more AddressType 2019-06-13 21:55:07 -04:00
Scott Shawcroft
6f6dcafd90
Minor tweaks based on Dan's feedback 2019-06-13 00:34:19 -07:00
Scott Shawcroft
a35d9b469d
Refactor deinit check to reduce code size. 2019-06-12 11:36:43 -07:00
Scott Shawcroft
eb21fc3e31
Add partial display update support.
Different operations to the display tree have different costs. Be
aware of these costs when optimizing your code.
* Changing tiles indices in a TileGrid will update an area
covering them all.
* Changing a palette will refresh every object that references it.
* Moving a TileGrid will update both where it was and where it moved to.
* Adding something to a Group will refresh each individual area it
covers.
* Removing things from a Group will refresh one area that covers all
previous locations. (Not separate areas like add.)
* Setting a new top level Group will refresh the entire display.

Only TileGrid moves are optimized for overlap. All other overlaps
cause sending of duplicate pixels.

This also adds flip_x, flip_y and transpose_xy to TileGrid. They
change the direction of the pixels but not the location.

Fixes #1169. Fixes #1705. Fixes #1923.
2019-06-12 11:32:39 -07:00
Dan Halbert
4fc189b60c Merge latest 4.0.x fixes into master 2019-06-11 16:16:29 -04:00
Dan Halbert
62de2506e4 Include display objects in gc. 2019-06-06 17:49:32 -04:00
Carlos
671178c8c4 [shared-module/audioio/WaveFile.h] Change sample_rate from uint16_t to uint32_t so it matches the sample rate type parsed from the WAV header format, fix #1922 2019-06-04 21:31:30 -05:00
Dan Halbert
613e12f99f Replace Broadcaster with enhanced Peripheral 2019-06-03 20:40:05 -04:00
Scott Shawcroft
5d0791cafb
Fix off-by-one error
It caused the bottom and right edges to be one pixel short.
2019-05-31 15:50:55 -07:00
Scott Shawcroft
7a117f52ed
Make point 2 in areas exclusive and simplify full_coverage. 2019-05-22 15:00:47 -07:00
Scott Shawcroft
3fad7de8db
Rework the pixel computation to use areas
This changes the displayio pixel computation from per-pixel to
per-area. This is precursor work to updating portions of the screen
(#1169). It should provide mild speedups because bounds checks are
done once per area rather than once per pixel. Filling by area also
allows TileGrid to maintain a row-associative fill pattern even when
the display's refresh is orthogonal to it.
2019-05-21 17:41:06 -07:00
Scott Shawcroft
00c39805f1
Remove old comment 2019-05-15 14:17:09 -07:00
Scott Shawcroft
5608e273a0
Add index and remove to Group. 2019-05-15 11:33:16 -07:00
Scott Shawcroft
46164c6ec6
Merge pull request #1837 from nickzoic/circuitpython-nickzoic-1800-wiznet-socket
WIP: Circuitpython nickzoic 1800 wiznet socket
2019-05-10 11:31:18 -07:00
Nick Moore
0d08dde62e randomize tcp source port for adafruit/circuitpython#1800 2019-05-10 13:56:33 +10:00
Nick Moore
af0bba0622 reset wiznet at network deinitialize adafruit/circuitpython#1800 2019-05-10 13:55:45 +10:00
Scott Shawcroft
e64bbc41ec
Handle -scale to 0 correctly in Group
Fixes #1839
2019-05-09 11:38:30 -07:00
Nick Moore
264fc2b070 Make wiznet5k RST pin optional adafruit/circuitpython#1800 2019-05-07 18:41:53 +10:00
Nick Moore
24934a1e8a Clean up list of NICs on network deinit adafruit/circuitpython#1800 2019-05-07 18:20:08 +10:00
Nick Moore
baa9c02c8b Add a kw-only argument "dhcp" to wiznet5k object 2019-05-02 16:05:33 +10:00
Nick Moore
09d0e99d5b assign variable socket number to DHCP 2019-05-02 16:05:33 +10:00
Nick Moore
09b83e96b3 Avoid socket #0 used by DHCP 2019-05-02 14:32:35 +10:00
Scott Shawcroft
f548305c07
Merge pull request #1815 from dhalbert/stop-flicker
Turn off auto_brightness if brightness is set
2019-04-18 15:48:39 -07:00
Dan Halbert
0113e0970e add Display.__init__() args for brightness and auto_brightness 2019-04-18 15:59:16 -04:00
Scott Shawcroft
c372567330
Fix off by one error in OnDiskBitmap
It resulted in the first row of pixels being pulled for out of bounds.

Fixes #1801
2019-04-17 15:17:11 -07:00
Scott Shawcroft
190bdf8117
Simplify type check in tick and init last 2019-04-16 10:44:09 -07:00
Scott Shawcroft
6132a05fd9
Include cleanup and style tweaks 2019-04-16 10:19:07 -07:00
Scott Shawcroft
0e03a321e4
Fully split gamepadshift from gamepad 2019-04-16 10:11:54 -07:00
Scott Shawcroft
c927e6b938
Split GamePadShift from GamePad to save space on most boards. 2019-04-15 15:40:06 -07:00
Radomir Dopieralski
eeef5359f9 Merge branch 'master' into gamepad-shift 2019-04-13 11:54:25 +02:00
Radomir Dopieralski
4dc286fa14 Reorganize the gamepad code 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
ae60968563 More refactoring 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
7e89beeb31 Optimize the size of code for gamepad 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
3469b1ec5d Add debouncing to GamePadShift 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
b485e45f4f Go back to simple bit-banging in GamePadShift, fix problems 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
a7925930fa Read one bit per system clock tick in GamePadShift 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
6ff4e0ecb0 Add GamePadShift for handling shift-register-based buttons 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
d39e7e7dd5 Use displayio.Display directly 2019-04-12 12:46:28 +02:00
Scott Shawcroft
72992070c5
Fix boards with no shared busses. 2019-04-09 11:36:10 -07:00
Scott Shawcroft
ac7822ba4c
Delete stale TODO 2019-04-08 17:37:30 -07:00
Scott Shawcroft
de48e4b262
Merge remote-tracking branch 'adafruit/master' into fix_cpx_display 2019-04-08 17:15:08 -07:00
Scott Shawcroft
0f003ac5b8
Reorganize board busses into shared-bindings and shared-module. 2019-04-08 16:58:50 -07:00
Radomir Dopieralski
8323721232 Stop hard-coding SPI frequency in FourWire
Instead remember and use the frequency, polarity and phase that was
set when the bus was first created.
2019-04-06 15:15:29 +02:00
Scott Shawcroft
7686f93ef4
Fix crash when getting board.SPI outside the VM
If one of the default pins was already in use it would crash.

The internal API has been refined to allow us to get the value
without causing an init of the singleton.

Fixes #1753
2019-04-05 19:06:37 -07:00
Melissa LeBlanc-Williams
97baa7899f Added comment regarding parameter loop 2019-04-05 11:11:27 -07:00
Melissa LeBlanc-Williams
8f1fc6c07d Added option to easily treat SPI parameter data as commands 2019-04-04 23:15:00 -07:00
Scott Shawcroft
6fcda1dec4
Support multi-byte values with Bitmap
It also corrects the behavior of single byte values.

Fixes #1744
2019-04-04 12:50:35 -07:00
caternuson
5298119aa2 change direction of shift right 2019-04-03 09:21:34 -07:00
Melissa LeBlanc-Williams
f1e4a2ffb9 Removed unnecessary bit-ANDing 2019-04-01 19:52:35 -07:00
Melissa LeBlanc-Williams
8b4ca24e56 Improved readability of Single Byte Bounds code 2019-03-31 14:17:54 -07:00
Melissa LeBlanc-Williams
e254597c24 Merge branch 'master' of https://github.com/adafruit/circuitpython into ssd1351-fix 2019-03-28 17:27:59 -07:00
Scott Shawcroft
9ff54fdf72
Merge pull request #1685 from makermelissa/master
Added option to enable toggling CS between init commands
2019-03-28 09:45:01 -07:00
Melissa LeBlanc-Williams
8087cb41e5 Merge branch 'master' of https://github.com/adafruit/circuitpython into ssd1351-fix 2019-03-27 20:18:37 -07:00
Melissa LeBlanc-Williams
2e0268cb09 Simplified cs toggling into fourwire only 2019-03-27 20:17:22 -07:00
Melissa LeBlanc-Williams
f3ec0514cd Simplified into fourwire only 2019-03-27 20:11:32 -07:00
Scott Shawcroft
9232ec50f1
Fix HID buffer lookup
The previous code assumed HID report ids were consecutive. This is
not true in the CircuitPython descriptor where report ids are fixed
for each report type.

Fixes #1617
2019-03-27 15:23:20 -07:00
Dan Halbert
374f210771 TileGrid: pixel_shader is not always a palette 2019-03-27 10:55:50 -04:00
Melissa LeBlanc-Williams
f4cede4747 Removed parameter so CS is always toggled 2019-03-26 18:46:13 -07:00
Melissa LeBlanc-Williams
b2ad16f5c8 Removed parameter so CS is always toggled 2019-03-26 18:34:07 -07:00
Melissa LeBlanc-Williams
a54493b4ae Added small delay inside toggle for edge cases 2019-03-26 07:45:17 -07:00
Melissa LeBlanc-Williams
09a1f06bbf Added small delay inside toggle for edge cases 2019-03-26 07:39:40 -07:00
Melissa LeBlanc-Williams
cc96c39e6d Fixed wrong operator 2019-03-25 23:58:58 -07:00
Melissa LeBlanc-Williams
c3329e224d Added Single Byte Boundaries option for certain displays 2019-03-24 23:59:28 -07:00
Melissa LeBlanc-Williams
b25c4baeec Moving Toggle to before command fixes driver issue 2019-03-23 21:04:25 -07:00
Melissa LeBlanc-Williams
fadb5a1024 Added option to toggle cs in displayio init sequence 2019-03-23 18:34:42 -07:00
Dan Halbert
26262cd477
Merge pull request #1670 from tannewt/fontio
Move Glyph and BuiltinFont into fontio
2019-03-20 17:36:04 -04:00
Scott Shawcroft
9f3ca66f97
Merge pull request #1676 from pewpew-game/bug1671
Make displayio.Palette support more than 255 colors
2019-03-20 14:13:18 -07:00
Radomir Dopieralski
f5cfd6e1f1 Make displayio.Palette support more than 255 colors
Fix #1671
2019-03-20 20:36:05 +01:00
Scott Shawcroft
5e2fec714c
Move Glyph and BuiltinFont into fontio
It was confusing in displayio.

Fixes #1662
2019-03-19 16:22:09 -07:00
Dan Halbert
43915133a1 after code.py runs, flush filesystem before resetting heap 2019-03-16 16:49:32 -04:00
Scott Shawcroft
946790bfb5
Add better PewPew error messages and update translations 2019-03-12 17:21:15 -07:00
Scott Shawcroft
224e9b1009
Standardize TileGrid to x and y properties over position
This brings it inline with Group. Also fixes #1613

This also includes a number of fixes for where a method is called
through a subclass. We now correctly get the native object.
Fixes #1567

Lastly, this adds subscript support to TileGrid for changing tile
indices. Similar to Bitmap, it accepts ints or 2-tuples.
2019-03-12 17:18:33 -07:00
Scott Shawcroft
ea45877ca5
Accept x and y kwargs into Group for initial position. 2019-03-12 17:17:32 -07:00
sommersoft
a498bcd94d add voice level getter 2019-03-12 16:10:54 -05:00
sommersoft
7aa0840b73 change voice 'gain' to 'level' 2019-03-12 10:24:54 -05:00
Radomir Dopieralski
caf51cf4eb Add default devices and tweak brightness in boards/pewpew10 2019-03-11 19:09:21 +01:00
sommersoft
e2fd34d7cc Merge branch 'dm-mixer' of https://github.com/adafruit/circuitpython into mixer_volume 2019-03-08 13:05:45 -06:00
Dan Halbert
1f31877d55 Rework background display task to allow reads from SPI SD card during display. Clarify code. Handle multiple displays better. 2019-03-07 00:08:16 -05:00
Dan Halbert
c854f6617a check display-bus transaction status and act accordingly 2019-03-06 13:45:48 -05:00
Dan Halbert
2eaa98ad71
Merge pull request #1601 from penguindustin/master
added height and width attributes for displayio
2019-03-06 12:43:55 -05:00
Dustin Mendoza
4145f87fcd changed from mp_int_t to uint16_t 2019-03-05 21:25:09 -08:00
Dan Halbert
146271fa58
Merge pull request #1604 from dhalbert/display_wait_for_frame-check-interrupts
Don't wait for display frame if interrupt pending
2019-03-04 13:55:13 -05:00
Dan Halbert
17bf2afa41
Merge pull request #1607 from pewpew-game/pewpew10.x-4.x
Add support for PewPew 10.x boards
2019-03-01 14:07:32 -05:00
Radomir Dopieralski
7afbfc7003 Use find_free_timer() 2019-03-01 16:46:59 +01:00
Bryan Siepert
76dc8e1ac8 fixed typo 2019-03-01 07:32:46 -08:00
Bryan Siepert
014595bff5 fixed whitespace, clarified variable name, and updated error messages 2019-03-01 07:17:50 -08:00
Radomir Dopieralski
a9074f7bd1 More style fixes 2019-03-01 16:11:22 +01:00
Radomir Dopieralski
89b2788d11 Apply review fixes:
* fix formatting
* fix copyrights
* fix CIRCUITPYTHON_GAMEPAD guards
* add CIRCUITPYTHON_PEW guards to reset
* fix module list order
2019-03-01 16:05:15 +01:00
Radomir Dopieralski
45fea86554 Rebase on top of CircuitPython 4.x 2019-03-01 14:59:21 +01:00
Bryan Siepert
398c7060f8 added monochrome, 8bpp indexed, and 32bpp ARGB BMPs 2019-02-28 23:08:12 -08:00
Dan Halbert
ced37c1001 Don't wait for display frame if interrupt pending 2019-02-28 22:36:50 -05:00
Radomir Dopieralski
48f0a5163e Reset timer when releasing _pew 2019-02-28 23:34:03 +01:00
Radomir Dopieralski
59f63eaef6 Handle new buttons 2019-02-28 23:34:03 +01:00
Radomir Dopieralski
55b511a5d8 Use a dedicated timer 2019-02-28 23:33:37 +01:00
Radomir Dopieralski
88e40193ae Add a _pew module 2019-02-28 23:32:58 +01:00
Dustin Mendoza
f127be4dd2 added height and width attributes for displayio 2019-02-25 16:39:20 -08:00
Bryan Siepert
b81072e750 (fork rebuild) Initial support for 16bpp 555&565 and 8bpp grayscale bitmaps 2019-02-23 10:58:46 -08:00
Dan Halbert
d218069f03
Merge pull request #1584 from tannewt/disable_concurrent_write_protection
Add option to disable the concurrent write protection
2019-02-21 17:15:50 -05:00
Scott Shawcroft
08158a7c34
Tweak the backlight PWM rate to be higher that audio range. Fixes #1571 2019-02-21 12:02:01 -08:00
Scott Shawcroft
1a0596a2fb
Add option to disable the concurrent write protection
This allows writing to the filesystem from the host computer and
CircuitPython by increasing the risk of filesystem corruption.
2019-02-21 10:45:41 -08:00
Scott Shawcroft
b1e8c43679
Fix reload while display is updating. 2019-02-19 14:51:39 -08:00
Scott Shawcroft
46fd60c703
Prevent infinite display update recursion and fix VFS mounting
Fixes #1529
2019-02-19 14:50:31 -08:00
Scott Shawcroft
c9f036ed40
Store the original layer in Group
As is we would return the native superclass object only.

Fixes #1551
2019-02-15 14:29:59 -08:00
Scott Shawcroft
473bdf48f6
A safe mode fix and displayio fixes
* 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-13 15:31:06 -08:00
Dan Halbert
66b0c67f54
Merge pull request #1536 from TG-Techie/patch-4
DISPIO: end_x can't be > height of shape
2019-02-12 19:17:10 -05:00
TG-Techie
4fbbb999b9
DISPIO: end_x can't be > height of shape
an author must have forgotten to change from height to width after copy paste.
2019-02-12 17:53:11 -05:00
Scott Shawcroft
1e16b3e134
Tweaks based on dhalbert's feedback. 2019-02-12 14:18:53 -08:00
Scott Shawcroft
c17f147be9
A variety of displayio improvements
This changes a number of things in displayio:
* Introduces BuiltinFont and Glyph so the built in font can be used by libraries. For boards with
  a font it is available as board.TERMINAL_FONT. Fixes #1172
* Remove _load_row from Bitmap in favor of bitmap[] access. Index can be x/y tuple or overall index. Fixes #1191
* Add width and height properties to Bitmap.
* Add insert and [] access to Group. Fixes #1518
* Add index param to pop on Group.
* Terminal no longer takes unicode character info. It takes a BuiltinFont instead.
* Fix Terminal's handling of [###D vt100 commands used when up arrowing into repl history.
* Add x and y positions to Group plus scale as well.
* Add bitmap accessor for BuiltinFont
2019-02-11 20:55:05 -08:00
Craig Forbes
de43911a68 Remove usb_midi.PortIn and PortOut constructors. 2019-02-06 22:22:15 -06:00
Scott Shawcroft
448ae64d8e
Add support for display rotation and raw commands
Display rotation is relative to the scan order of the display.
The scan order can be found by scrolling the display with command
0x37 `display_bus.send(0x37, struct.pack(">H", i % 128))`

Fixes #1504
2019-02-01 00:32:03 -08:00
Scott Shawcroft
354a26963b
Correctly handle no backlight pin. 2019-01-31 11:42:15 -08:00
Scott Shawcroft
2c069a5685
Polish up comments 2019-01-31 11:42:15 -08:00
Scott Shawcroft
4672866eec
Remove Sprite references 2019-01-31 11:42:14 -08:00
Scott Shawcroft
601a910f4e
More improvements to Terminal:
* 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-31 11:42:14 -08:00
Scott Shawcroft
6145f08cc8
Support adjustable backlight brightness 2019-01-31 11:42:14 -08:00
Scott Shawcroft
69bc5e189b
Rudamentary backlight support 2019-01-31 11:42:14 -08:00
Scott Shawcroft
1a1dbef992
Hook up the terminal based on the first display. 2019-01-31 11:42:14 -08:00
Scott Shawcroft
590e029198
Begin font parsing and packing for terminal 2019-01-31 11:42:13 -08:00
Scott Shawcroft
fb0970ec6e
Add terminalio 2019-01-31 11:42:13 -08:00
Scott Shawcroft
73cf490635
Add TileGrid 2019-01-31 11:42:13 -08:00
Scott Shawcroft
b2f2abcb22
Make palette color ordering consistent with ColorConvertes and fix blinka. 2019-01-23 14:44:46 -08:00
Scott Shawcroft
3139d0dc20
Use common delay function during display init so we don't starve background tasks. 2019-01-23 14:43:54 -08:00
Scott Shawcroft
a380865655
Merge remote-tracking branch 'adafruit/master' into HEAD 2019-01-22 14:02:07 -08:00
Dan Halbert
777408ff8d struct.pack_into incorrect buffer size check 2019-01-21 11:45:38 -05:00
Scott Shawcroft
2bcf81fb9e
Merge pull request #1479 from siddacious/master
adding height and width to OnDiskBitmap for #1460
2019-01-21 00:32:49 -08:00
Bryan Siepert
ab2ad7ba45 adding height and width to OnDiskBitmap for #1460 2019-01-20 22:33:22 -08:00
Dan Halbert
a8f4aa4796 Merge remote-tracking branch 'adafruit/master' into struct-compat 2019-01-20 21:47:13 -05:00
Dan Halbert
7a09af73ec Improve struct compatibility with CPython 2019-01-20 15:12:34 -05:00
Roy Hooper
50af08a6f3 Merge branch 'master' into pixelbuf 2019-01-19 16:33:59 -05:00
Scott Shawcroft
ae52c964c2
Cleanup display rework for PR.
Fixes #1465. Fixes #1337. Fixes #1168
2019-01-18 13:47:40 -08:00
Scott Shawcroft
fddc98858a
fix nonetype handling and nrf never reset 2019-01-17 18:51:40 -08:00
Scott Shawcroft
6404aaf411
Fix up nrf and using board.SPI in FourWire 2019-01-17 18:19:07 -08:00
Scott Shawcroft
760bd8d8a4
share fourwire and make nrf compile 2019-01-17 15:15:59 -08:00
Scott Shawcroft
2d136d58bf
Fix other builds and hallowing 2019-01-17 14:45:29 -08:00
Scott Shawcroft
5277138c99
pyportal compiles and tweak blinka colors 2019-01-17 10:57:05 -08:00
Scott Shawcroft
84292ad890
External fourwire works and blinka splash after 2019-01-17 00:20:16 -08:00
Scott Shawcroft
05d8885a1a
Rework displays in prep for dynamic support and 8bit parallel. 2019-01-16 12:05:20 -08:00
Scott Shawcroft
bfd531281a
Fix default values on last line. 2019-01-15 10:15:55 -08:00
Scott Shawcroft
747f2cfe26
Add subclass support to displayio.
Also, swap make_news to accept a kwarg map and refine param checking.

Fixes #1237
2019-01-14 17:29:19 -08:00
Scott Shawcroft
a14762a16c
Add support for rendering a shape.
Fixes #1171
2019-01-14 17:29:15 -08:00
Roy Hooper
ffe734edf7 Fresh combined checkin of _pixelbuf library. 2019-01-13 23:51:13 -05:00
Scott Shawcroft
62a8cc2825
Merge pull request #1453 from tannewt/text_on_pyportal
Enable the display on pyportal
2019-01-11 10:33:16 -08:00
Dan Halbert
50ee5ef24c merge translations; add bleio comments; fix minor sphinx issues in midi 2019-01-10 21:12:17 -05:00
Scott Shawcroft
6594937a65
Support rendering groups inside groups 2019-01-10 17:30:16 -08:00
Scott Shawcroft
3dd59c3d5f
Polish thanks to Dan's feedback 2019-01-10 11:00:40 -08:00
Scott Shawcroft
b5e40f52c2
Add USB MIDI support for SAMD and nRF.
The API should be identical to using a UART for MIDI.

Fixes #672
2019-01-09 14:02:11 -08:00
Dan Halbert
f66f55b4ed add CharacteristicBuffer; UART seems to work! 2019-01-07 22:46:20 -05:00
Dan Halbert
1dc3957e72 LocalPeripheral is now Peripheral; more work on basic GATTS support; UART not working yet 2018-12-30 22:33:49 -05:00
Dan Halbert
ef39e72c7c free event handlers on reset; fix typo in Broadcaster 2018-12-29 13:55:10 -05:00
Dan Halbert
4d1f0ec07b Add Broadcaster. Reset correctly on reload. 2018-12-28 23:34:23 -05:00