LP-173 Initialize all settings objects automatically

#467 Open
Repository
librepilot
Branch
next

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

git checkout next
git remote add mindnever/librepilot https://bitbucket.org/mindnever/librepilot.git
git fetch mindnever/librepilot
git merge --no-ff -m 'Merged in mindnever/librepilot/LP-173-Init_all_settings_objects_automatically (pull request #467)' remotes/mindnever/librepilot/LP-173-Init_all_settings_objects_automatically
Author
  1. Vladimir Zidar
Reviewers
Description

This PR fixes LP-173 and also other instances where settings being saved from GCS are unitialized. (autotune module, txpid, etc..).

It adds new pios_initcall that handles settings objects (ones marked with settings="true" in xml) initialization in similar way modules are done.

uavobject.c.template is modified so it marks *Initialize() function as initcall.

pios_board files are doing SETTINGS_INITIALISE_ALL; because it needs to be done just after settings storage has been initialized, but before first settings is used (usually Hw*Settings).

And finally, all explicit calls to *SettingsInitialize() are removed as redundant.

About the memory issue: The impact on F4 targets is negligible. However on F1 and F3, memory footprint is significantly increased, not only because of memory required for objects data storage, but even more is consumed by telemetry module and memory inefficient way of registering periodic updates (both telemetry & logging). Therefore, LP-432 is required to offset for increased usage.

  • Issues 2 related issues

Comments (3)

  1. Lalanne Laurent

    How about others UAVO settings that still initialized another time like previous method ?

    Like HomeLocation, TakeOffLocation, EKFConfiguration UAVO objects and maybe others.

    1. Vladimir Zidar author

      That can be removed also, but as long as they have settings="true" inside xml, they will be initialized automatically. To be honest, I did not think of them while removing other explicit calls - I did global search for SettingsInitialize(

      Doing another initialization later doesn't hurt. Though, it is good idea to remove those calls which are truly redundant.