Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uint16 for temporary variables in displayio.TileGrid #4287

Merged
merged 1 commit into from
Mar 4, 2021

Conversation

deshipu
Copy link

@deshipu deshipu commented Feb 27, 2021

Should fix #4284

@FoamyGuy
Copy link
Collaborator

I tried this out on a magtag:

Adafruit CircuitPython 6.2.0-beta.2-183-g2a3cd5b29-dirty on 2021-02-27; Adafruit MagTag with ESP32S2

I'm still getting the hard crash and reset from this code:

font = terminalio.FONT
glyph= font.get_glyph(ord('A'))
letter = displayio.TileGrid(glyph.bitmap, pixel_shader=displayio.Palette(1), default_tile=glyph.tile_index, tile_width=glyph.width, tile_height=glyph.height)
letter.transpose_xy = True

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

This is a fine clean-up fix but I don't think it will solve #4284, because the width and height are pretty small integers, and they'll fit in either a signed or unsigned 16-bit int.

@jposada202020
Copy link

jposada202020 commented Feb 28, 2021

I tried too. Hard Crash and reboot.

Adafruit CircuitPython 6.2.0-beta.2-84-g79b122675-dirty on 2021-02-27; Adafruit MagTag with ESP32S2

with the following code

import displayio
import terminalio

font = terminalio.FONT
glyph= font.get_glyph(ord('A'))
letter = displayio.TileGrid(glyph.bitmap, pixel_shader=displayio.Palette(1), default_tile=33, tile_width=6, tile_height=14)
letter.transpose_xy = True

@deshipu
Copy link
Author

deshipu commented Feb 28, 2021

I suspect that in the case of a font bitmap, one of the dimensions is actually quite large, and that's causing problems.

@tannewt tannewt requested a review from dhalbert March 1, 2021 21:22
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

This is a good correction, but we have two reports that it doesn't fix the original bug, #4284, so I'm not sure where to go from here. We could just accept this but leave the bug open, or someone can work on fixing the bug.

@dhalbert
Copy link
Collaborator

dhalbert commented Mar 4, 2021

I confirmed that this fix does not fix the crashing. It's important, but there's some other bug.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@tannewt tannewt merged commit 3698d4b into adafruit:main Mar 4, 2021
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.

Using displayio.Tilegrid.transpose_xy will crash the MAGTAG sending it to Safe Mode
5 participants