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

Beta - Fix memory overlap in DeviceBuffer #272

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

elral
Copy link
Collaborator

@elral elral commented Nov 8, 2023

Description of changes

With PR #253 the limitation for the max devices per type was eliminated.
Before this PR memory was allocated in the device buffer for each single device. The highest amount of memory is 31 byte for one encoder.
Now the memory gets allocated in the device buffer for all devices of one type at once. If the required memory is more than 255 bytes, e.g. 9 encoders need 9 * 31bytes = 279 bytes, only 23 bytes gets reserved as the size to allocate memory is limited to a byte.

In allocateMem.cpp/.h the variable size within the functions allocateMemory() and FitInMemory() must be defined as uint16_t.

Fixes #271

@elral elral added the beta-bug label Nov 8, 2023
@elral elral self-assigned this Nov 8, 2023
@elral elral requested a review from DocMoebiuz as a code owner November 8, 2023 09:33
Copy link

github-actions bot commented Nov 8, 2023

Firmware for this pull request:
Firmware.zip

Copy link
Collaborator

@DocMoebiuz DocMoebiuz left a comment

Choose a reason for hiding this comment

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

Nice!

@DocMoebiuz DocMoebiuz merged commit d874cf8 into MobiFlight:main Nov 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

With FW 2.4.3 LCD's might not work or Mega can crash
2 participants