Commit Graph

1010 Commits

Author SHA1 Message Date
Kenny bb25aeee51 fix code formatting that pre-commit --all-files did not locally report 2021-08-07 19:40:07 -07:00
Kenny 051d7a970e fix rotation and mirroring
now works with all vector shapes, even those with internal reference locations
that are negative. All shape locations are anchored to their 0,0 but they can
display pixels from negative coordinates if the shape's location on the screen
would have room for it.
2021-08-07 19:32:02 -07:00
Kenny b5837b157d improve transpose and mirror
* add heuristic to avoid drawing area unnecessarily
* fix Polygon.points
* fix transpose
* fix mirror x and y

Known broken:
Polygon with negative Y coordinates does not work right.
2021-08-07 19:31:22 -07:00
microDev 063e3946d6
Merge pull request #5094 from jepler/quirc
Add qrio: Decode QR codes with quirc lib
2021-08-07 09:30:20 +05:30
Scott Shawcroft be2342f32f
Merge pull request #5072 from microDev1/traceback
Add traceback module
2021-08-06 12:10:17 -07:00
Jeff Epler 67551c1ac0 qrio: Split QRInfo & PixelPolicy to their own .c/.h files 2021-08-06 09:53:17 -05:00
Jeff Epler 2e8eb43dcc Use new quirc define for small stacks
.. and revert stack enlargement of esp32-s2
2021-08-05 12:52:43 -05:00
microDev 870f26bfc4
traceback module refinements 2021-08-05 20:11:15 +05:30
Jeff Epler bd903f2f03 Add qrio: Decode QR codes with quirc lib 2021-08-04 09:16:00 -05:00
Kenny 8c22993e28 fix linter 2021-08-02 20:38:37 -07:00
Kenny 8607cdd783 vectorio: add draw protocol
* Removes VectorShape from user python interactions
* Re-integrates vectorio with displayio behind draw protocol implementations
* Implements draw protocol with VectorShape
* Composes VectorShape behaviors into Rectangle, Circle and Polygon
* Fixes terrible pixel garbage being left behind
* Improves redraw performance (heuristically) by tracking dirty area separately from current area.

Known Issues:
It does not work with transposed views.
2021-08-02 20:19:54 -07:00
Scott Shawcroft 1e225610cc
Add ability to disable BLE workflow
Call `supervisor.disable_ble_workflow()` and the BLE workflow will
be disabled until the chip is reset.

This also includes a couple fixes:
1. Terminals can now be deinit by setting the tilegrid to NULL. This
  prevents using the tilegrid before display is init.
2. Fix BLE serial send amount when sending more than a single packet.

Fixes #5049
2021-08-02 18:37:19 -07:00
Kenny 1b67b91edd fix inverted logic 2021-07-31 16:59:44 -07:00
Kenny 0afd863224 vectorio: palettes don't color dirty rectangles
This is a breaking change with previous palette semantic with respect to python code that uses vectorio.
Displayio has breaking changes in cpy 7 for Group's removal of max_size parameter so this is as good a
time as any to break everything.

Currently:
To color vectorio shapes correctly you have to pass in a palette with length 2. Palette[0] must be set transparent and palette[1] must be the color you want.

New:
To color vectorio shapes correctly you pass in a palette with length >= 1. Palette[0] will be the color of the shape.

Also improves pixels per second when skipping areas that aren't covered by the shape.
2021-07-31 16:32:01 -07:00
microDev a3998d0626
add atexit module 2021-07-30 09:32:28 +05:30
microDev f371c0a609
add traceback module 2021-07-28 18:06:23 +05:30
Dan Halbert 901a6c27c0 remove gamepad; deprecate gamepadshift 2021-07-26 22:15:09 -04:00
Scott Shawcroft f84cb94819
Remove OSError(0) and old network modules
The newer modules are `socketpool` and `ssl`.

Fixes #3924, related to #2021, closes #1880, closes #2273, closes #2274
2021-07-21 17:33:40 -07:00
Dan Halbert f1d2eee58f Make KeyMatrix row output switch faster 2021-07-21 09:08:32 -04:00
Jeff Epler 2556fce862 OnDiskBitmap: Fix memory corruption when using palette image
The number of palette entries set was accidentally 4x too much,
because the wrong looping variable was used.
2021-07-19 09:25:26 -05:00
microDev 40b085746a
Merge pull request #5006 from tannewt/scanentry_match_all
ScanEntry.matches() kwarg all -> match_all
2021-07-18 09:45:58 +05:30
Kattni Rembor c21e16162c Remove _ from common_hal__adafruit_pixelbuf. 2021-07-16 14:08:39 -04:00
Kattni Rembor dc2907ac1b Rename _pixelbuf to adafruit_pixelbuf, alias. 2021-07-16 13:31:40 -04:00
Scott Shawcroft 448597b4a0
ScanEntry.matches() kwarg all -> match_all
Related to #3007
2021-07-15 14:36:57 -07:00
Scott Shawcroft 0fadf028ef
Create first BLE-only board, Micro:Bit v2
This fixes build issues with USB off, tweaks the README to allow
for BLE-only boards and adds the Micro:Bit v2 definition.

Fixes #4546
2021-07-14 09:55:51 -07:00
Kattni Rembor 4579bf9b12 Rename rainbow to rainbowio 2021-07-12 14:40:01 -04:00
Kattni Rembor 825a706135 Turn off MIDI on one build, fix name. 2021-07-08 17:31:10 -04:00
Kattni Rembor 289575a811 Adding rainbow module. 2021-07-08 15:55:13 -04:00
Dan Halbert c37f354d2d
Merge pull request #4958 from dhalbert/rp2040-audio-fixes
RP2040 PWMAudioOut: Release DMA channels after play has finished
2021-07-02 10:03:54 -04:00
Dan Halbert 33bbb8b1f4 RP2040 PWMAudioOut: Release DMA channels after play has finished. 2021-07-01 17:36:29 -04:00
Jeff Epler d83a21b984 ColorConverter: Add "BGR" color modes.
The BGR565_SWAPPED mode is needed for OV2640 cameras.
2021-06-30 10:29:31 -05:00
Dan Halbert 62aca944f4 Failed to advance buffer ptrs in usb_cdc.Serial properly 2021-06-25 09:50:31 -04:00
Scott Shawcroft 57f898b774
Merge pull request #4915 from Neradoc/fix-4193
Fix 4193 - set hidden_by_parent when adding to displayio group
2021-06-24 15:23:33 -07:00
Scott Shawcroft b81573d439
Merge pull request #4891 from dhalbert/keypad-scanning-events
keypad: support for vector and matrix key scanning
2021-06-24 10:25:21 -07:00
Neradoc 63bcee0a2c set hidden_by_parent when adding to displayio group 2021-06-24 17:19:06 +02:00
Dan Halbert 4f538b6c09 remove pressed() and get_states_into() 2021-06-23 15:10:38 -04:00
Dan Halbert 7774b18895 Add reset() to scanners. Clear .overflow on EventQueue.clear(). 2021-06-23 15:04:09 -04:00
Dan Halbert acf90fbb43 many renamings; add overflowed flag to EventQuque 2021-06-23 09:57:15 -04:00
Dan Halbert f052dc4d8b ShiftRegisterKeys: allow specifying sense of latch 2021-06-21 19:50:05 -04:00
Dan Halbert 51c547a5b9 add generic arg validation routines; add interval args to keypad 2021-06-21 12:13:39 -04:00
Dan Halbert 154e91ab85 add EventQueue.store_next() to allow reusing event objects 2021-06-21 08:18:06 -04:00
Dan Halbert 8cd7e774e7 add KeyMatrix columns_to_anodes arg 2021-06-18 12:03:47 -04:00
Dan Halbert af66931f71 Added keypad.ShiftRegisterKeys 2021-06-17 20:51:45 -04:00
Dan Halbert a152bd3b72 add .num_keys and .store_states() to Keys and KeyMatrix 2021-06-17 12:02:54 -04:00
Dan Halbert cd31136c30 factor out keypad.EventQueue 2021-06-16 15:55:54 -04:00
Dan Halbert 3d18c5c327 Use a single list of keypad scanners 2021-06-16 13:29:38 -04:00
Dan Halbert 1803a6a71d both Keys and KeyMatrix work 2021-06-15 11:15:09 -04:00
Dan Halbert 350652ee21 Keys works; more testing to do 2021-06-14 22:59:17 -04:00
Dan Halbert 32eec85230 compiles 2021-06-14 20:54:43 -04:00
Dan Halbert 627c426259 wip 2021-06-14 16:00:15 -04:00
Dan Halbert 01a8a95b2c fix signed/unsigned compilation problem 2021-06-10 01:14:16 -04:00
Dan Halbert d3d9e0a487 add debouncing 2021-06-10 00:07:23 -04:00
Tsutomu IKEGAMI 0a7c839c13 Fix format (expand tab) 2021-06-10 12:11:12 +09:00
Tsutomu IKEGAMI 72c4a5a523 Fix coordinate conversion algorithm of partial refresh area in displayio.TileGrid 2021-06-10 11:47:51 +09:00
Dan Halbert 7d23206018 Inital keypad work: Keys working: one pin per key
keypad.Buttons and keypad.State

Buttons -> Keys; further work

wip

wip

wip: compiles

about to try

keypad.Keys working
2021-06-08 20:27:31 -04:00
lady ada 467a4e7664 fix comment 2021-06-07 19:51:57 -04:00
lady ada b39dd84560 move the col/row offsets to the top so oleds can take advantage of em 2021-06-07 19:43:49 -04:00
lady ada 2ff9e9766f handclang 2021-06-07 12:39:59 -04:00
lady ada 8f1c25c8ae fix SH110x mode, the SH1107 is actually column not row mode BUT the SD1107 module we use is vertical orientation (confusing!) so row/col are NOT swapped. we will have to fix the SH1107 driver to match. this fix required for SH1106 (which uses the same page mode commands but ISNT rotated) 2021-06-06 18:25:40 -04:00
Tsutomu IKEGAMI a4be61912c Fix move cursor esc sequence of terminalio to meet ANSI standard 2021-06-03 20:40:37 +09:00
Dan Halbert 3930440bc5 Fix usb_cdc.enable(console=False, data=True) 2021-06-02 11:29:56 -04:00
Scott Shawcroft 6ee9acc900
Merge pull request #4755 from jepler/esp32s2-protomatter
Esp32s2 protomatter
2021-06-01 13:32:34 -07:00
Jeff Epler 9df8f235b1 OnDiskBitmap: INCOMPATIBLE CHANGE: Allow them to use palettes
Before, when an OnDiskBitmap was a paletted bitmap type, the palette
was internal to the OnDiskBitmap, and it internally performed the palette
conversion itself.  When using with a tilegrid, a ColorConverter() object
always had to be passed.

Now, an OnDiskBitmap has a "pixel_shader" property.  If the bitmap is
a paletted bitmap type, it is a (modifiable) Palette object.  Otherwise,
it is a ColorConverter() object as before. This allows palette effects
to be applied to paletted OnDiskBitmaps.

Code that used to say:
```python
face = displayio.TileGrid(odb, pixel_shader=displayio.ColorConverter())
```
must be updated to say:
```python
face = displayio.TileGrid(odb, pixel_shader=odb.pixel_shader)
```

Compatible code for 6.x and 7.x can say
```python
face = displayio.TileGrid(odb, pixel_shader=getattr(odb, 'pixel_shader', ColorConverter())
```
2021-05-28 10:53:21 -05:00
Jeff Epler 9ff6ccba48 remove commented-out code 2021-05-27 11:33:17 -05:00
Jeff Epler 11288c1c28 esp32s2: Add rgbmatrix support 2021-05-26 11:21:59 -05:00
Jeff Epler 0d7f257eae displayio: Pause rgbmatrix during soft-reset
We can't handle rgbmatrix's interrupts from here until the display is
reinitialized, so set the display as paused.

With this change, I can survive multiple cycles with wifi+rgbmatrix
on an esp32s2.  Before, it usually failed.
2021-05-26 11:18:02 -05:00
Dan Halbert 0f66832829
Merge branch 'main' into hid_devices-gc 2021-05-24 18:17:52 -04:00
Scott Shawcroft 0d92558012
Merge pull request #4800 from dhalbert/too-many-hid-devices
Handle too many HID devices properly
2021-05-24 14:26:41 -07:00
Dan Halbert 5a9b95e611 unlock board.I2C() on reset 2021-05-21 17:49:50 -04:00
Dan Halbert c6eb0283dc Don't set num_hid_devices before it's validated 2021-05-21 17:34:30 -04:00
Dan Halbert 5a81f275cf Don't change number of HID devices until it's vetted 2021-05-21 17:29:21 -04:00
Dan Halbert 7d0cda2614 gc all pointers in hid_devices properly 2021-05-21 16:32:55 -04:00
Scott Shawcroft 5643355e90
Merge remote-tracking branch 'adafruit/main' into simplify_status_led 2021-05-20 08:35:15 -07:00
Dan Halbert aebee2de73 Handle USB_HIGHSPEED for MIDI also 2021-05-19 07:43:47 -04:00
Kamil Tomaszewski da248d1594 spresense: Fix USB CDC and MSC 2021-05-18 17:02:16 +02:00
Dan Halbert fa6c06fb38 count in/out endpoints; allow more usb modules on low-endpoint boards 2021-05-13 21:59:02 -04:00
Scott Shawcroft 1a0b4193b7
Simplify the status LED to save power
This also removes the need to pin share because we don't use the
status LED while user code is running.

The status flashes fallback to the HW_STATUS LED if no RGB LED is
present. Each status has a unique blink pattern as well.

One caveat is the REPL state. In order to not pin share, we set the
RGB color once. PWM and single color will be shutoff immediately but
DotStars and NeoPixels will hold the color until the user overrides
it.

Fixes #4133
2021-05-13 14:41:20 -07:00
Scott Shawcroft a70fc0caee
Merge pull request #4744 from tannewt/merge_1.14
Merge MicroPython 1.14
2021-05-11 16:11:58 -07:00
Scott Shawcroft e02a26453c
Merge MicroPython 1.14 into CircuitPython 2021-05-11 15:07:40 -07:00
ajs256 3c8b8cdba7 `make translate` 2021-05-10 16:57:38 -07:00
ajs256 7cd8e98962 Make two error messages sentence case 2021-05-10 16:51:13 -07:00
Dan Halbert f504af3127 fix HID; fix interface name table creation 2021-05-09 00:42:45 -04:00
Jeff Epler 5e06c91244
Merge pull request #4716 from tyomitch/main
s/Circuit Python/CircuitPython/g
2021-05-08 08:47:29 -05:00
Scott Shawcroft 42f4065c8a
Merge remote-tracking branch 'adafruit/main' into merge_1.13 2021-05-06 11:17:53 -07:00
Artyom Skrobov 908d83d1f2 s/Circuit Python/CircuitPython/g
Some comments and messages used the non-standard spelling
2021-05-06 16:22:35 +03:00
Scott Shawcroft 3fda0c0a1b
Fix board builds and use MP_ERROR_TEXT in py and extmod 2021-05-05 17:51:52 -07:00
Dan Halbert adc3d7d55e update Python API according to review comments 2021-05-03 22:29:02 -04:00
Dan Halbert d2b558993e merge from main, including MicroPython 1.12 merge 2021-05-03 20:56:04 -04:00
Dan Halbert 5b5de4b92e fix sHID report doc and API 2021-05-03 20:53:31 -04:00
Scott Shawcroft b35fa44c8a
Merge MicroPython 1.12 into CircuitPython 2021-05-03 14:01:18 -07:00
Dan Halbert be7b2b00a8 uncrustify with newer version of uncrustify 2021-04-30 10:40:12 -04:00
Dan Halbert 71a8cadb09 working! 2021-04-29 22:26:38 -04:00
Dan Halbert abfb020d41 MSC, CDC, HID keyboard definitely working 2021-04-29 17:41:43 -04:00
Dan Halbert f06d54524d merge from adafruit 2021-04-28 23:48:26 -04:00
Dan Halbert 587aedd14f rework storage allocation 2021-04-28 13:00:44 -04:00
Dan Halbert 8500e846c6 partially working 2021-04-27 23:53:23 -04:00
Dan Halbert f98a54628b wip: compiles 2021-04-27 14:37:36 -04:00
Scott Shawcroft 17fcd499b2
Merge pull request #4649 from tannewt/merge_1.11_2
Merge MicroPython v1.11 into CircuitPython
2021-04-27 11:02:02 -07:00
Dan Halbert 7a40b4daec very much WIP 2021-04-26 23:54:01 -04:00
Scott Shawcroft 76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Dan Halbert c26e49c2e6 wip: starting to try to compile 2021-04-25 23:17:41 -04:00
Dan Halbert 9d1fcc3b14 merge from main 2021-04-25 10:27:52 -04:00
Dan Halbert aea3c4d3ab wip 2021-04-25 10:23:59 -04:00
Dan Halbert 2ba2574ebf
Merge pull request #4619 from tyomitch/microbit
[build] Allow USB to be set to 0
2021-04-24 10:31:29 -04:00
Dan Halbert 556a126917 wip: getting closer 2021-04-23 21:44:13 -04:00
Scott Shawcroft 80e8b4ac14
Merge pull request #4635 from jepler/pcc
WIP: Implement 'ParallelImageCapture' for samd51
2021-04-23 13:31:53 -07:00
Artyom Skrobov 4e3c1d4a4c [build] Allow USB to be set to 0
Unify USB-related makefile var and C def as CIRCUITPY_USB.

Always define it as 0 or 1, same as all other settings.

USB_AVAILABLE was conditionally defined in supervisor.mk,
but never actually used to #ifdef USB-related code.

Loosely related to #4546
2021-04-23 11:13:34 -04:00
Dan Halbert 2b4c88d633 wip: partial HID, still needs rework 2021-04-23 00:18:05 -04:00
Dan Halbert 64e0958916 wip: descriptor building 2021-04-21 23:25:36 -04:00
Dan Halbert 6b18a51d57 wip: working on descriptor templates 2021-04-20 22:20:34 -04:00
Dan Halbert 51ccf8dc30 wip: revert usb_descriptor changes; use raw descriptors instead 2021-04-19 23:24:18 -04:00
Jeff Epler 76d68f21ac displayio: Add RGB555/565/_SWAPPED format support
This is helpful when displaying frames from an OV7670 camera, which
uses the RGB565_SWAPPED format internally.
2021-04-19 10:23:47 -05:00
Scott Shawcroft 5ccd5dc08b
Fix struct.pack with padding bytes
It used to validate the following arg could fit in a single byte.
Now, it always uses zero to pad.
2021-04-16 12:39:23 -07:00
Dan Halbert 6cb751ab06 wip: revamp API names 2021-04-14 22:10:09 -04:00
Scott Shawcroft 3978b50b8d
Merge pull request #4489 from gamblor21/audiomixer_rp2040
Add non M4 audiomixer support
2021-04-14 12:19:17 -07:00
Dan Halbert 4a7e129287 wip: latent usb device enabling/disabling 2021-04-13 23:33:44 -04:00
gamblor21 cd8deb0b72 Removed all the M4 comments 2021-04-13 17:36:14 -05:00
Artyom Skrobov c6ee471b52 Merge branch 'main' of https://github.com/adafruit/circuitpython into patch-3 2021-04-13 00:32:19 -04:00
Mark 7ace53f22c
Remove comment for define being M4 only it can be M7 too
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2021-04-12 22:35:55 -05:00
Jeff Epler 280aefffb7 IncrementalEncoder: Re-add missing update of quarter_count
This lost line caused incremental encoders to stay stuck at 0 forever.

I seem to have lost it while trying to create tidy commits :frown:
2021-04-09 08:47:40 -05:00
Jeff Epler 3ce0b512f8 rasberrypi: IncrementalEncoder: factor out state machine 2021-04-08 16:25:47 -05:00
Jeff Epler 78089107bc displayio.Bitmap: Allow modification though the buffer protocol
It is required to call .dirty() with appropriate arguments after modifications through the buffer protocol, or the display might not be updated correctly.
2021-04-03 10:41:20 -05:00
gamblor21 9bf4b4d81e Fixes to math for level calculations 2021-04-02 16:47:25 -05:00
hathach 7c3975ecf2 update tinyusb to fix midi buffer overflow issue 2021-04-02 17:57:56 +07:00
Tsutomu IKEGAMI 171820e53f Fix format 2021-04-01 20:45:15 +09:00
Tsutomu IKEGAMI 5f77d07760 Fix format 2021-04-01 20:26:10 +09:00
Tsutomu IKEGAMI 3c4d763fef Fix format. 2021-04-01 18:04:33 +09:00
Tsutomu IKEGAMI 7810cb275c Add two escape sequences to terminalio.Termial:
- ESC[yy;xxH : move cursor to (xx, yy)
- ESC[2J     : clear screen
2021-04-01 17:33:57 +09:00
Dan Halbert a13da2ad57
Merge pull request #4486 from kmatch98/displayio_area_expand
`displayio` and `vectorio`: move to displayio_area_union and away from _expand
2021-03-26 23:00:05 -04:00
Artyom Skrobov 8056af8648 [synthio] add a simple MidiTrack implementation 2021-03-26 16:38:10 -04:00
Jeff Epler 172715194f adafruit_bus_device: SPIDevice: Fix so it works with bitbangio.SPI
.. by calling methods, same as we did for I2C
2021-03-26 14:51:53 -05:00
Jeff Epler a70b679ed5 bitbangio.SPI.read: Support write_value, fix some other nits 2021-03-26 12:24:09 -05:00
gamblor21 0b212e2243 Add non M4 audiomixer support 2021-03-25 17:30:40 -05:00
Kevin Matocha 56362a9806 remove duplicated code, replace with displayio_area_canon 2021-03-25 11:31:07 -05:00
Kevin Matocha 9485805b6a move to displayio_area_union and away from _expand 2021-03-25 11:21:39 -05:00
Kevin Matocha 3785eb7779 correct rectangle size dimensions 2021-03-25 09:36:40 -05:00
Scott Shawcroft 98425c9a9d
Merge pull request #4464 from kmatch98/transform_fix
update logic for displayio.TileGrid's transform_xy
2021-03-22 15:52:23 -07:00
Scott Shawcroft d52662856b
Merge pull request #4462 from jepler/disable-usb-cdc
storage: Correct when we check for USB mounts
2021-03-22 15:52:10 -07:00
Kevin Matocha 24831a79d3 update logic for transform_xy 2021-03-22 16:38:56 -05:00
Jeff Epler 5a0e9945e6 storage: Correct when we check for USB mounts
Closes #4417
2021-03-22 11:45:54 -05:00
Jeff Epler a05aab8304
Merge pull request #4454 from jepler/bitmaptools-readinto-4bit
Fix reading 4-bit data
2021-03-21 19:56:23 -05:00
Jeff Epler c64fccbeee hex may be more obvious 2021-03-21 13:48:08 -05:00
Jeff Epler 7229fe631d Fix reading 4-bit data 2021-03-21 13:37:38 -05:00
Jeff Epler e084a92671
Merge pull request #4432 from jepler/bitmap-dirty-improvements
Bitmap dirty improvements
2021-03-20 13:09:59 -05:00
Kevin Matocha 9b188934d1 off by one error in rotozoom dirty_area 2021-03-19 21:23:55 -05:00
Jeff Epler 39500cdeab Merge commit '40829d4cc85394513ca631cff23254344e29786c' of https://github.com/kmatch98/circuitpython into bitmap-dirty-improvements 2021-03-19 20:40:30 -05:00
Jeff Epler 95ac6c716b rotozoom: switch to using set_dirty_area + write_pixel 2021-03-19 20:40:23 -05:00
Kevin Matocha 40829d4cc8 switch to > in displayio_area_canon 2021-03-19 20:30:37 -05:00
Dan Halbert 1512ca520b Fix PWMOut non-error handling and never reset 2021-03-19 09:57:21 -04:00
Jeff Epler d0125617fd
Merge pull request #4428 from kmatch98/bitmap-read-2
Add `reverse_rows` to speedy bitmaptools.readinto function
2021-03-18 18:41:35 -05:00