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

fix: PICO_SCANVIDEO_PIXEL_... macros assume 5-bit color #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

patricksurry
Copy link

I needed a few extra gpio pins, so reduced the color depth by adding some definitions to CMakeLists:

add_definitions(
         # -DPICO_SCANVIDEO_48MHZ=1
        -DPICO_SCANVIDEO_COLOR_PIN_BASE=0
        -DPICO_SCANVIDEO_COLOR_PIN_COUNT=12
        -DPICO_SCANVIDEO_DPI_PIXEL_RSHIFT=0u
        -DPICO_SCANVIDEO_DPI_PIXEL_GSHIFT=4u
        -DPICO_SCANVIDEO_DPI_PIXEL_BSHIFT=8u
        -DPICO_SCANVIDEO_DPI_PIXEL_RCOUNT=4
        -DPICO_SCANVIDEO_DPI_PIXEL_GCOUNT=4
        -DPICO_SCANVIDEO_DPI_PIXEL_BCOUNT=4
    )

This works but the PICO_SCANVIDEO_PIXEL_FROM_RGB8 macro is broken since it assumes 5 bit values so colors are messed up.

This PR fixes it and some related macros.

btw, loving this library, thanks for sharing!

@kilograham
Copy link
Contributor

ooh, excellent, this has needed fixing for years ;-)

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.

2 participants