Replies: 4 comments 4 replies
-
This is an update on the progress from the initial idea above. Starting point:Since the substantial PR #147 by @elral, I wanted to push his modifications a little bit further to completion. TL;DR: Not all (parts of the) objects are allocated dynamically, plus some space is occupied by the index vectors (e.g. encoders[], ledSegments[]…) Technical details (you can skip this section if not interested):
The improvement consists in removing index vectors altogether (using different object management structures) and placing all data in the common buffer. A sideline story:In the meantime, following some comments regarding PR #152, I was trying to help by "de-composing" the individual changes included in the PR with the aim of putting them in the form of individual issues/PR pairs to speed up acceptance. I started a branch with individual commits targeting following points:
One thing I did not change yet was the splitting of client functions that use MFxxx device objects (e.g. Putting it all together:After some chats with @elral, during which I explained the whole situation to him, he kindly agreed that we could possibly proceed this way (pending his final approval):
As soon as the final details are reviewed by @elral and me, I will immediately make the links to the repository branches available for evaluation. Final request:@DocMoebiuz @neilenns I would appreciate if you could briefly read the above and let me know if we can proceed this way or there are any suggestions or comments. |
Beta Was this translation helpful? Give feedback.
-
first of all thanks to everyone for your efforts and passion that you are putting into it. We have to be careful to not end up having too many moving pieces. I am friend of simplicity and taking smaller steps, one at a time. We have been living with the current firmware for so long. We have made a lot of memory optimizations. We don't have to have all optimizations in one step. Let's finish merging the work by @elral:
If we don't finish these changes first we will have a lot of headache with merging changes back and forth into branches. It's great to see that there are so many ideas which we can tackle then easier. A general thought and decision that i have taken is that i want to focus on a better and easier way allowing people to bring their own (exotic) devices to Mobiflight. This means that we have to be careful to not make the core too complicated to understand. The general idea is to not include all these different devices into the official MobiFlight Core Firmware but focus on simple yet flexible interfaces for adding individual stuff if a user wants to. We can then allow users to build their own firmware if they need it. things like, I would like TMxxxx instead of Max7219 will then be possible. I am thinking of creating a place where we can collect community contributions, e.g. maintaining a list in a wiki/github. I strongly believe that decoupling the community devices from the MobiFlight Core Firmware will increase the speed with which we can support a broader range of ICs. Based on the community feedback and interest we can then still decide if a device will eventually make it i to the MF Core Firmware. It's kind of like an "Incubator". With this idea in mind, I believe the way how Ralf wanted to split and bundle the files was a good fit. I will finish the current MF Connector Release and then I will be able to focus more on the firmware. It's just a matter of a couple of days until 9.3 will be released. Feedback welcome! You're awesome! |
Beta Was this translation helpful? Give feedback.
-
Just one general thought: any change to the firmware that gets rid of the per-device limit will be the first time (at least since I've been involved in MobiFlight) where firmware changes will have a corresponding change on the desktop app. The desktop app also maintains the max of each type of device (in the board.json files) and verifies that when adding modules. We'd need to think through whether there is a hard dependency on firmware version vs. desktop app version should a change like this be done. What happens if the desktop also gets rid of the check but then connects to devices without a firmware with the new change? What about the other way around (new firmware, older desktop?). |
Beta Was this translation helpful? Give feedback.
-
If anybody is interested in looking at the actual code, as it would appear at the end of the changes, here is the link. In any case, I'd still like to have a feedback on whether the itemized version of @elral 's PR can still be of interest (integrated with the last changes I left pending). |
Beta Was this translation helpful? Give feedback.
-
I think this is the right moment to introduce a (semi-)new topic in the wake of @elral's last changes (particularly issues #127 and #148), that have built an excellent foundation for a further step in the direction of making the firmware more efficient.
I'm nearly finished with some modifications that will allow the full "pseudo-dynamic" allocation of devices. This basically means several improvements:
MAX_LEDSEGMENTS
,MAX_MFSERVOS
,MAX_INPUT_SHIFTERS
...).As long as available space is sufficient, a user could define any number of LED displays or Servos or encoders... in any desired combination (within the hardware pin limits of course).
About the first point, a reminder note just for the sake of completeness: as already discussed elsewhere, a more efficient use of the RAM "only" allows to optimize the number of devices that can be configured. A similar improvement regarding the set of device types would be interesting, but this is related to the flash memory usage, which implies a change at the level of the compilation process.
The firmware remains fully compatible with the Connector, although it could benefit from some modifications in the latter.
The main one could be that a "memory full" condition could (in practice) only be detected once the configuration is uploaded; so the user has to be properly notified, possibly adding some specific information that helps him in solving the issue.
As of now, I am close to completing the code; I have no indication yet about the possible gains (or losses?) regarding the last point above, but I'm planning to verify them with the tests that will immediately follow completion.
One thing is for sure: the extent of the changes (particularly in combination with the ones introduced by @elral) will require a good round of testing from anyone that's willing to contribute.
In a few days I will send the link to my git branch so anyone interested can have a look. (@DocMoebiuz , @neilenns, ...)
I'm obviously looking forward to your feedback and comments.
Beta Was this translation helpful? Give feedback.
All reactions