Skip to content

Conversation

@jepler
Copy link

@jepler jepler commented Feb 2, 2020

This makes Palette more similar to pixelbuf, and lets e.g., the unmodified "wheel" function be used to set pixel values.

Testing performed: I adapted an existing demo (pygamer) of mine to directly use wheel() tuples instead of converting them to 24-bit integers, and it worked.

kattni
kattni previously approved these changes Feb 2, 2020
Copy link

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this! @jepler If you'd like another test, please provide me with a test build for CLUE and I will do so.

kattni
kattni previously approved these changes Feb 2, 2020
Copy link

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested successfully on CLUE with display_text. Thanks for adding this!

@jepler jepler force-pushed the displayio-tuplecolor branch 2 times, most recently from 8edac05 to 29615fd Compare February 3, 2020 16:13
This makes Palette more similar to pixelbuf, and lets e.g., the unmodified
"wheel" function be used to set pixel values.
@jepler jepler force-pushed the displayio-tuplecolor branch from 29615fd to 1458719 Compare February 3, 2020 16:54
Copy link

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed! 🌮 Thanks for adding this! Tested on CLUE.

Comment on lines +49 to +54
CFLAGS_INLINE_LIMIT = 15
CFLAGS_BOARD = --param inline-unit-growth=12 --param max-inline-insns-auto=15
else
ifeq ($(TRANSLATION), de_DE)
CFLAGS_INLINE_LIMIT = 15
CFLAGS_BOARD = --param inline-unit-growth=12 --param max-inline-insns-auto=15
Copy link
Collaborator

@dhalbert dhalbert Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you test that the pinyin and german builds actually work? Try a simple I2C example or something. I found that setting inline limit below 35 or so can produce broken code.

@tannewt
Copy link
Member

tannewt commented Feb 3, 2020

I'm ok merging this in but I want to note why I didn't support tuples. I only supported ints because it's easy to provide a conversion library in Python and having only one type of input keeps the code slimmest. Ints are a better single thing to support because tuples cause at least one more allocation.

@jepler
Copy link
Author

jepler commented Feb 3, 2020

I will give I2C a test on an M4 board with the specific optimization flags that we put on pewpew m4. I'll do the proposed merge of color value parsing (of pixelbuf and displayio palette) under a separate PR so that the clue lib doesn't have to wait on this.

@dhalbert
Copy link
Collaborator

dhalbert commented Feb 3, 2020

BTW, I just suggested I2C because the underlying ASF4 code uses a lot of potentially inlined stuff. There's nothing special about I2C per se.

@dhalbert
Copy link
Collaborator

dhalbert commented Feb 3, 2020

OK, I am going to close this and open a new PR for two reasons:

  1. Making space in pewpew_m4 via different means (turning off analogio for now).
  2. Seeing if I can easily generalize passing a color sequence to more than a tuple. neopixel et al take a sequence, which could be a tuple, a list, or any kind of iterator (e.g. range(3) works).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants