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

convert GpioMappings to an array in protobuf #631

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

bsstephan
Copy link
Contributor

! ! ! WARNING ! ! !
Current users of main will find their config is wiped by this change. You will have to go into webconfig and redo your config. 0.7.5 users should be unaffected.

My Python-brain wrote GpioMappings in a descriptive way that's great for dynamic languages, but it turned out that in our code, I had to quickly treat the dict-like message in protobuf as an array in C, to make it easy to work with. This was fine, but a bit funky, and kept the protobuf descriptive. However, this array pattern would have to have been duplicated for profiles-as-GpioMappings, which would have meant more funky code and more stuff residing in memory for no good reason. This has the mappings as an array in the protobuf, which is slightly less obvious when reading a protobuf config, but this may only matter to me, so making the rest of the code less funky is a good trade-off.

this simplifies some code and also makes the upcoming profile refactor
considerably easier
Copy link
Contributor

@arntsonl arntsonl left a comment

Choose a reason for hiding this comment

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

Much cleaner!

@arntsonl arntsonl merged commit c6e598d into OpenStickCommunity:main Nov 20, 2023
63 checks passed
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