Commit Graph

1542 Commits

Author SHA1 Message Date
Jeff Epler 9133b23a37 bitmaptools: Add readinto
When reading uncompressed bitmap data directly, readinto can work
much more quickly than a Python-coded loop.

On a Raspberry Pi Pico, I benchmarked a modified version of
adafruit_bitmap_font's pcf reader which uses readinto instead of
the existing code. My test font was a 72-point file created from Arial.

This decreased the time to load all the ASCII glyphs from 4.9 seconds to
just 0.44 seconds.

While this attempts to support many pixel configurations (1/2/4/8/16/24/32
bpp; swapped words and pixels) only the single combination used by
PCF fonts was tested.
2021-03-14 13:57:46 -05:00
Scott Shawcroft b413535ee1
Merge pull request #4376 from kmatch98/displayio_bitmap
add fill_region and draw_line to bitmap_tools
2021-03-12 16:50:39 -08:00
Kevin Matocha a9afa0d9d4 Move input checks to shared-module, update docstrings 2021-03-11 16:18:17 -06:00
Kevin Matocha 85f0f07d51 add fill_region and draw_line to bitmaptools 2021-03-10 11:37:27 -06:00
Dan Halbert 24ac8152dd Clarify further; fix type error 2021-03-07 20:32:59 -05:00
Dan Halbert 1a6c021239 Add clarifying comment re carriage-return char. 2021-03-07 17:04:27 -05:00
Dan Halbert a6cb7d7069 Document readline() and readlines() 2021-03-07 15:34:07 -05:00
Dan Halbert d919b7fa4a fix #4352 2021-03-07 14:13:20 -05:00
Dan Halbert 8594396a07 Add caveat for usb_cdc.Serial.connected 2021-03-07 14:07:07 -05:00
Jeff Epler b23c5b2d68 nvm: fix doc markup
closes #4336
2021-03-06 07:54:54 -06:00
Dan Halbert cd48c5ee83
Merge pull request #4315 from dhalbert/rp2040-i2c-short-writes
RP2040: Implement short I2C writes (2 bytes or less) using bitbangio
2021-03-03 12:42:47 -05:00
Jeff Epler efc2667b5f
Merge pull request #4186 from jepler/update-protomatter-rp2
Enable protomatter on RP2040 builds
2021-03-02 19:01:37 -06:00
Dan Halbert f31b472309 Merge remote-tracking branch 'adafruit/main' into rp2040-i2c-short-writes 2021-03-02 15:17:12 -05:00
Dan Halbert 9939c59caa wip 2021-03-02 15:16:55 -05:00
Scott Shawcroft e4f0e47d9f
Merge pull request #4233 from pewpew-game/displayio-group-list
displayio: make Group use a python list internally
2021-03-02 09:59:58 -08:00
Scott Shawcroft d0eab5c561
Merge pull request #4256 from kmatch98/bt_cleanup
Add `bitmaptools` module
2021-03-01 18:24:12 -08:00
Jeff Epler 238484ec26 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-03-01 15:18:32 -06:00
ajs256 f722df70c8
Fix formatting in SPI docs
Close #4293 by changing  `..note::` to `.. note::`.
2021-03-01 09:06:24 -08:00
Radomir Dopieralski 24473b7983 Separate out mp_obj_list_insert for use in display.Group
Note that for some reason this makes the binary 500 bytes larger!
2021-02-27 21:13:55 +01:00
Radomir Dopieralski 38fb7b511b Remove max_size from displayio.Group
Still accept it as an argument. Add deprecation note.
2021-02-27 20:52:38 +01:00
Radomir Dopieralski e9953754ea Add displayio.Group.sort() method 2021-02-27 20:52:38 +01:00
Jeff Epler 1d1ff5f308 Merge remote-tracking branch 'origin/main' into update-protomatter-rp2 2021-02-26 09:56:35 -06:00
Scott Shawcroft 3f08cb47b8
Merge remote-tracking branch 'adafruit/main' into busio-uart-rp 2021-02-25 16:59:15 -08:00
Scott Shawcroft 52bc935fa7
A few minor fixes for corner cases
* Always clear the peripheral interrupt so we don't hang when full
* Store the ringbuf in the object so it gets collected when we're alive
* Make UART objects have a finaliser so they are deinit when their
  memory is freed
* Copy bytes into the ringbuf from the FIFO after we read to ensure
  the interrupt is enabled ASAP
* Copy bytes into the ringbuf from the FIFO before measuring our
  rx available because the interrupt is based on a threshold (not
  > 0). For example, a single byte won't trigger an interrupt.
2021-02-25 16:50:57 -08:00
Kevin Matocha c883bb773b Rearrange input parameters 2021-02-24 16:03:50 -06:00
microDev 5d7fdafcde
implement suggested changes
- add internal buffering
- rtc initialization fix
2021-02-25 00:48:36 +05:30
Kevin Matocha cd4d55a573 yet another sphinx try 2021-02-24 08:05:40 -06:00
Kevin Matocha e858db07f0 Another sphinx try 2021-02-24 07:59:32 -06:00
Kevin Matocha 2815c6dafa More sphinx attempts 2021-02-24 07:49:34 -06:00
Kevin Matocha af5ad50125 More sphinx fixes 2021-02-24 01:18:30 -06:00
Kevin Matocha 18658b77f3 Sphinx docstring updates 2021-02-24 01:00:13 -06:00
Kevin Matocha b720028642 Add bitmaptools module 2021-02-23 23:23:14 -06:00
Dan Halbert 67406488d1 merge from upstream; re-alphabetize 2021-02-19 14:22:50 -05:00
Dan Halbert 9d4442e298 handle reads/writes larger than buffers; add .write_timeout 2021-02-19 14:15:31 -05:00
microDev b12ccefbe6
uart implementation for rp2040 2021-02-19 18:36:00 +05:30
Jeff Epler 5c758523c0 requested changes 2021-02-18 17:19:34 -06:00
Jeff Epler ffae89b191 bitops: fix argument parsing 2021-02-18 16:10:57 -06:00
Jeff Epler d56fe7691d bitops: doc correction 2021-02-18 15:44:51 -06:00
Jeff Epler 7fd4567893 bitops: rename from _bit_transpose, describe the algorithm 2021-02-18 15:41:23 -06:00
Jeff Epler ac0ffc5656 _bit_transpose: fix docs 2021-02-18 11:45:48 -06:00
Jeff Epler c284728621 bit_transpose: Support from 2 to 7 strands, not just 8 2021-02-18 11:33:13 -06:00
Jeff Epler 9cf7d73c6c core: add bit_transpose function
.. this version can only handle exactly 8 bits "across".  The restriction
may be relaxed in a future revision.
2021-02-18 11:32:47 -06:00
Dan Halbert ed49c02feb add timeout; finish up for PR 2021-02-17 23:24:11 -05:00
Dan Halbert c26de0136a works! no timeouts 2021-02-16 17:39:36 -05:00
Dan Halbert 0b8f1b9a90 wip: usb_cdc.serials 2021-02-15 20:06:18 -05:00
Dan Halbert 93d788543c Merge remote-tracking branch 'adafruit/main' into secondary-cdc 2021-02-15 20:03:53 -05:00
Dan Halbert d54b5861a3 wip 2021-02-12 19:01:14 -05:00
Dan Halbert 3e4328140c fix off-by-one PWM top issue 2021-02-12 15:53:31 -05:00
Jeff Epler ff1942cff6 Enable protomatter on RP2040 builds
Also found a race condition between timer_disable and redraw, which
would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable
or put a delay or print inside it.  That's what pausing inside reconstruct
fixes.

So that the "right timer" can be chosen, `timer_allocate` now gets the `self`
pointer.  It's guaranteed at this point that the pin information is accurate,
so you can e.g., find a PWM unit related to the pins themselves.
This required touching each port to add the parameter even though it's
unused everywhere but raspberrypi.
2021-02-12 08:25:15 -06:00
Dan Halbert f0564b4986 merge from upstream; complicated webusb merge 2021-02-11 18:50:02 -05:00