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

Updated ZStripeMultiplexMapper to support variable tile sizes #1590

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andytheengineerguy
Copy link

This change allowed me to use the ZStripeMultiplexMapper with a tile height of 13, for an LED panel that required this change for the mapping to work

I decided to update ZStripeMultiplexMapper - rather than make a new mapping - because this change may be helpful for future panels that require different tile heights or widths, like mine.

I've updated the existing mappings so that their original tile size values (8 and 4) are accounted for.

Copy link
Owner

@hzeller hzeller left a comment

Choose a reason for hiding this comment

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

Looks good in general, but make sure to not modify global variables messing with other instances of the same class.


void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const {
static const int tile_width = 8;
static const int tile_height = 4;
static const int tile_width = width_;
Copy link
Owner

Choose a reason for hiding this comment

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

if you use width_ and height_ member variables, you can't assign this to static variables here, as they are global and override them with whoever ran last.

Just replace all uses of tile_height, and tile_width with the new members height_ and width_.

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