Skip to content

Beta - Fix memory overlap in DeviceBuffer#272

Merged
DocMoebiuz merged 2 commits intoMobiFlight:mainfrom
elral:memory_overlap_DeviceBuffer
Nov 8, 2023
Merged

Beta - Fix memory overlap in DeviceBuffer#272
DocMoebiuz merged 2 commits intoMobiFlight:mainfrom
elral:memory_overlap_DeviceBuffer

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
@github-actions
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
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