Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jepler
Copy link

@jepler jepler commented Mar 21, 2021

Related to adafruit/Adafruit_CircuitPython_ImageLoad#47

An incorrect mask was being used when extracting 4-bit data from a file.

kmatch98
kmatch98 previously approved these changes Mar 21, 2021
Copy link

@kmatch98 kmatch98 left a comment

Choose a reason for hiding this comment

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

Looks great. You beat me to it!

int bit_offset = 4 * (reverse_pixels_in_element ? (1 - x % 2) : x % 2);

value = (rowdata8[byte_offset] >> bit_offset) & 7;
value = (rowdata8[byte_offset] >> bit_offset) & 15;
Copy link

Choose a reason for hiding this comment

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

Would be more obvious if written as 0x0f.

Copy link
Collaborator

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

I tested this successfully with a Feather RP2040 and the imageload simpletest script. Confirmed this does resolve the issue.

@jepler
Copy link
Author

jepler commented Mar 22, 2021

One action has been stuck in "upload artifacts" for 4 hours. Gonna merge without green.

@jepler jepler merged commit a05aab8 into adafruit:main Mar 22, 2021
@jepler jepler deleted the bitmaptools-readinto-4bit branch November 3, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants