LP-173 Initialize all settings objects automatically

#467 Merged at 754eca9
  1. Vladimir Zidar

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.

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.