Handle SYS_AUTOSTART
0 the same as no valid airframe being available
#25645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved Problem
@sfuhrer found that when you want to handle the case
SYS_AUTOSTART
is reset to 0 by a user of a PX4-based product you currently cannot do so in the autostart external airframe scriptrc.autostart_ext
because if the parameter has the value 0 that script doesn't even get executed.Solution
Always run the ROMFS internal and SD card external airframe scripts and handle the case
SYS_AUTOSTART
is 0 in the same place as any other invalid airframe setup.This allows catching the
SYS_AUTOSTART
being reset to 0 in an external airframe script but also emits an error whenever that's not caught e.g. empty Pixhawk board freshly flashed.Changelog Entry
Alternatives
Should this be caught in a different way such that the user experience on fresh configured boards stays the same?🤔I could add that to the condition
Test coverage
@sfuhrer tested this with an
rc.autostart_ext
that handles the caseSYS_AUTOSTART
was reset to 0.EDIT: I also did some testing, see #25645 (comment)