Commit Graph

550 Commits

Author SHA1 Message Date
Scott Shawcroft
6d388a34eb
Merge pull request #1943 from adafruit/4.0.x
Merge in gamepadshift fix to master.
2019-06-13 12:26:04 -07:00
Scott Shawcroft
6f6dcafd90
Minor tweaks based on Dan's feedback 2019-06-13 00:34:19 -07:00
Radomir Dopieralski
5e265f4fbd
When clearing gamepad buffer, use the last button state, not 0
When reading the accumulated button presses in gamepad and gamepadshift,
don't clear the buffer to "no buttons pressed", but instead set it to
the current (last checked) state. This clears the accumulated presses,
but retains any ongoing ones.

This fixes #1935
2019-06-12 11:42:41 -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
6fed24e1b6 WIP 2019-06-10 07:18:28 -04:00
sommersoft
9e4396bdcd
Merge pull request #1920 from tannewt/fix_rst
Improve rST consistency for rst2pyi use
2019-06-07 23:41:00 -05:00
Dan Halbert
62de2506e4 Include display objects in gc. 2019-06-06 17:49:32 -04:00
Scott Shawcroft
84e89146d0
Merge pull request #1893 from elvis-epx/ps2
Add PS/2 support with ps2io module
2019-06-06 10:24:04 -07:00
Baozhu Zuo
f45daae09c
This __init__.h should be redundant. I deleted it for you 2019-06-06 15:44:29 +08:00
Elvis Pfützenreuter
1da8d4b4da Add PS/2 support -- ps2io module 2019-06-04 18:05:46 -03:00
Dan Halbert
613e12f99f Replace Broadcaster with enhanced Peripheral 2019-06-03 20:40:05 -04:00
Dan Halbert
63ac37946d 1. Remove advertising data construction in C: it's all done in Python now
2. Add scan response capability to advertising.
2019-06-02 23:21:30 -04:00
Dan Halbert
12f1d9d30c fix advertisement length check; add Service.secondary attribute 2019-05-31 18:03:05 -04:00
Scott Shawcroft
cfe24b8532
Improve rST consistency for rst2pyi use 2019-05-30 19:02:47 -07:00
Jason Pecor
a9a2227167
Removed warning box regarding SAMD21 builds
The support matrix shows that pulseio is supported for all SAMD21/SAMD51 variants. Removing warning to avoid confusion.
2019-05-27 14:08:19 -05:00
Dan Halbert
6cec81bcb5 Need to enable ble before scanning 2019-05-23 22:05:16 -04:00
Dan Halbert
1639354e5f Scanner working, but not very first time 2019-05-23 16:07:54 -04: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
Dan Halbert
b71f6c97ce Merge remote-tracking branch 'adafruit/master' into ble-scanner 2019-05-21 15:33:48 -04:00
Dan Halbert
ee8119779e WIP 2019-05-17 15:47:12 -04:00
Scott Shawcroft
5608e273a0
Add index and remove to Group. 2019-05-15 11:33:16 -07:00
Scott Shawcroft
b7b55e0c0a
Make Group iterable via a generic native iterator.
Fixes #1694
2019-05-14 15:15:23 -07:00
Dan Halbert
d3ce9280e2
Merge pull request #1883 from tannewt/fix_1881
Check native object in case of early access
2019-05-14 15:30:44 -04:00
Scott Shawcroft
bf682d14b3
Remove native init check from stage.
It isn't needed because the object is passed in, not self. To be
passed in it must be inited.
2019-05-14 10:20:04 -07:00
Matt Land
0b1c1c1d92
Update Palette.c
Remove None, add in byte and bytearray examples
2019-05-14 08:03:34 -05:00
Scott Shawcroft
f29de51325
Check native object in case of early access
If a native displayio object is accessed before it's super().__init__()
has been called, then a placeholder is given that will cause a crash if
accessed. This is tricky to get right so we detect this case and raise
a NotInplementedError instead of crashing.

Fixes #1881
2019-05-13 17:31:30 -07:00
Matt Land
ad211b23be
add documentation of transparency 2019-05-10 17:35:51 -05:00
Matt Land
214dfed703
Add documentation for Palette shared binding
Add documentation for the palette subscript operator and how to use it.
2019-05-10 16:41:13 -05:00
Nick Moore
af0bba0622 reset wiznet at network deinitialize adafruit/circuitpython#1800 2019-05-10 13:55:45 +10:00
Nick Moore
e00a702ce9 Stop DHCP when configuring IP address adafruit/circuitpython#1800 2019-05-10 09:20:57 +10:00
Nick Moore
832f07a6e9 Update docs for wiznet5k adafruit/circuitpython#1800 2019-05-07 21:48:44 +10:00
Nick Moore
264fc2b070 Make wiznet5k RST pin optional adafruit/circuitpython#1800 2019-05-07 18:41:53 +10:00
Nick Moore
d97c81b0c9 Update docs to include new 'dhcp' constructor parameter 2019-05-02 19:14:22 +10:00
Nick Moore
baa9c02c8b Add a kw-only argument "dhcp" to wiznet5k object 2019-05-02 16:05:33 +10:00
Nick Moore
58d1d99701 Fix socket.recv() buffer length from e23bad3a 2019-05-02 13:13:56 +10:00
Dan Halbert
0113e0970e add Display.__init__() args for brightness and auto_brightness 2019-04-18 15:59:16 -04:00
Dan Halbert
4fc0f8b25c Turn off auto_brightness if brightness is set 2019-04-18 13:57:27 -04:00
Scott Shawcroft
bfbe9323ee
Merge pull request #1807 from pewpew-game/stage-cast-native
Allow use of displayio.Display subclasses in _stage
2019-04-17 10:37:32 -07:00
Radomir Dopieralski
3a65ff970a Allow use of displayio.Display subclasses in _stage 2019-04-17 17:21:34 +02:00
Dan Halbert
b5e283af68
Merge pull request #1808 from pewpew-game/gamepad-doc
Update GamePad docs to include pull-downs
2019-04-17 11:06:19 -04:00
Dan Halbert
6684a3c723
Merge pull request #1778 from pewpew-game/gamepad-shift
Add GamePadShift for handling shift-register-based buttons
2019-04-17 10:22:24 -04:00
Radomir Dopieralski
e46bf7e7c6 Update GamePad docs to include pull-downs 2019-04-17 11:18:30 +02: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
Nick Moore
9c42a72275 Fix up single-byte access to nvm.ByteArray 2019-04-16 14:53:44 +10: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
c0a553e90f Add title to docs 2019-04-12 22:52:19 +02:00
Radomir Dopieralski
016efb5c68 Add GamePadShift to docs 2019-04-12 22:00:03 +02:00
Radomir Dopieralski
7aab3e8c93 Re-use an error message in _stage 2019-04-12 21:31:06 +02:00
Radomir Dopieralski
4dc286fa14 Reorganize the gamepad code 2019-04-12 20:43:29 +02:00
Radomir Dopieralski
049e80993d Sync gampad_singleton with the long lived copy 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
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
Radomir Dopieralski
c3136f4f32 Enable displayio for uGame10 board
Also, make the _stage library work with the fourwire bus, to re-use the
display.
2019-04-12 01:10:57 +02:00
Scott Shawcroft
a152ac1cef
Merge remote-tracking branch 'adafruit/master' into pybadge_revd 2019-04-10 10:58:45 -07:00
Dan Halbert
c0c809ad4b Fix version skew for bast_pro_mini build 2019-04-09 22:52:53 -04:00
Scott Shawcroft
5028f87b09
Tweak pybadge and fix display bugs
* Update pybadge pins and flash for rev D
* TileGrid now validates the type of the pixel_shader.
* Display actually handles incoming subclass objects.
* MicroPython will inspect native parents to see if special
  accessors are used.
2019-04-09 18:32:52 -07:00
Scott Shawcroft
72992070c5
Fix boards with no shared busses. 2019-04-09 11:36:10 -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
5015036c06
Merge pull request #1758 from pewpew-game/fourwire-frequency
Stop hard-coding SPI frequency in FourWire
2019-04-08 17:02:07 -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
Radomir Dopieralski
4b3cb7b6db Expose displayio.Display.bus
With the bus exposed, we can send custom commands to the display, to
leverage advanced features specific to the display, which are not
exposed by default.
2019-04-06 14:25:08 +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
Scott Shawcroft
04a4e8a38d
Always check TileGrid's x, y
When using an int index you could end up writing past the end of
TileGrid's memory.

Fixes #1747
2019-04-05 13:10:47 -07:00
Melissa LeBlanc-Williams
8f1fc6c07d Added option to easily treat SPI parameter data as commands 2019-04-04 23:15:00 -07:00
Nick Moore
781d301bb6 Remove unnecessary MP_WEAK declarations 2019-04-02 13:33:22 +11:00
Nick Moore
f846fa109e enable NRFX RTC adafruit/circuitpython#1046 2019-04-02 13:27:28 +11:00
Dan Halbert
0653bca323
Revert "Circuitpython nickzoic 1046 nrf rtc" 2019-03-29 16:41:29 -04: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
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
Nick Moore
93684737eb Fix up messages & wild stab at translations for adafruit/circuitpython#1046
The mysterious MP_WEAK linking bug still exists, thus the new message for 'set'.
2019-03-28 09:56:48 +11:00
Nick Moore
ff6395fa4e workaround for problem with adafruit/circuitpython#1046
the __weak linking works fine so long as these functions are not identical.
I have not yet worked out why.
2019-03-28 09:50:09 +11:00
Nick Moore
b09d2c3c62 enable NRFX RTC adafruit/circuitpython#1046 2019-03-28 09:50:09 +11:00
Melissa LeBlanc-Williams
2f7b338a4b Comment Cleanup 2019-03-26 18:56:25 -07: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
5f0e71ccb4 Merge branch 'master' of https://github.com/adafruit/circuitpython into ssd1351-fix 2019-03-26 18:23:02 -07:00
Melissa LeBlanc-Williams
0df40534f3 Merge branch 'master' of https://github.com/adafruit/circuitpython 2019-03-26 18:22:30 -07:00
Scott Shawcroft
3f42a49a6b
Merge pull request #1674 from pewpew-game/bug1669
Properly calculate BPP for displayio.Bitmap
2019-03-26 15:49:42 -07:00
Scott Shawcroft
8ea5fedf19
Merge pull request #1682 from rhwlo/add-socket.recv_into
shared-bindings/socket: add socket.recv_into
2019-03-26 14:28:07 -07:00
Radomir Dopieralski
d553df95b0 Reuse "Not connected" message in bleio 2019-03-25 21:41:40 +01:00
Radomir Dopieralski
81fe8060d7 Properly calculate BPP for displayio.Bitmap
Fix #1669
2019-03-25 19:40:40 +01:00
Melissa LeBlanc-Williams
c3329e224d Added Single Byte Boundaries option for certain displays 2019-03-24 23:59:28 -07:00
Radomir Dopieralski
cc6fb4595e Reuse existing error message in busio.i2c
Remove a period from the error message, so that the same message as in
SPI and other places in I2C can be re-used.
2019-03-25 01:41:52 +01:00
Melissa LeBlanc-Williams
d9de1b9926 Updated RTD comment to reflect new param defaulting True 2019-03-24 08:23:46 -07:00
Melissa LeBlanc-Williams
0c33f7fdb4 Enable CS toggle for displayio by default 2019-03-23 20:23:23 -07:00
Melissa LeBlanc-Williams
2bb63cbeb3 Added new parameter description in displayio RTD comment 2019-03-23 18:53:04 -07:00
Melissa LeBlanc-Williams
fadb5a1024 Added option to toggle cs in displayio init sequence 2019-03-23 18:34:42 -07:00
Joshua Coats
e23bad3a3a shared-bindings/socket: add socket_recv_into 2019-03-23 10:49:43 -07:00
Scott Shawcroft
4b0afc855d
Fix up sphinx 2019-03-19 18:37:41 -07: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
494a9d3825
Merge pull request #1640 from tannewt/final_displayio_changes
Final displayio changes before 4.0.0
2019-03-13 18:24:04 -04:00