Commit Graph

154 Commits

Author SHA1 Message Date
Andrew Tridgell 17f8b0b11a AP_Param: disable debug code by default
found on EU dev call
2021-09-16 21:05:48 +10:00
Andrew Tridgell 10cbd3fd80 AP_Param: added a flag for hidden parameters 2021-09-07 10:36:16 +10:00
Andrew Tridgell 0b948d3faf AP_Param: allow save_sync without send 2021-04-21 07:12:55 +10:00
Andrew Tridgell 23785c00dc AP_Param: improved queue handling and added set_and_save_by_name_ifchanged 2021-04-21 07:12:55 +10:00
Andrew Tridgell eac027b5c5 AP_Param: fixed handling of group_element=255 in sentinal detection
EK3_DRAG_BCOEF_Y has a group element of 255, which was being detected
as a sentinal
2021-04-20 16:59:17 +10:00
Andrew Tridgell 160b25c557 AP_Param: fixed KEY_DUMP option
use right index, and use ::printf
2021-04-15 06:57:16 +10:00
Andrew Tridgell 7b98ab0f12 AP_Param: added get_param_by_index
useful for parameter conversion within an object
2021-04-15 06:57:16 +10:00
Peter Barker 936aa63135 AP_Param: remove confusing comment
The code refered to is within is_sentinel - and it has a copy of the
comment
2021-03-19 12:21:25 +11:00
Andrew Tridgell ac35867c17 AP_Param: fixed valgrind errors with AP_Param::ParamToken 2021-01-26 10:43:09 +11:00
Andrew Tridgell 6c684538d3 AP_Param: greatly speed up param download with disabled parameters
allows fast skip over disabled subgroups. This removes a long delay
with param download on a MatekF405-STD where the final parameters
associated with the OSD took 80ms to fetch, causing a long loop delay
2021-01-26 10:43:09 +11:00
Andrew Tridgell 4d58bcb321 AP_Param: support restoring from parameter backup region
if header on primary parameter storage is corrupt then restore from
backup
2021-01-16 06:47:10 +11:00
Peter Barker f12191b4b1 AP_Param: fix typo 2020-12-16 19:30:29 +11:00
Peter Barker 840c386a33 AP_Param: add _FLAG to AP_PARAM_NO_SHIFT
Just for consistency with the other flags
2020-12-16 19:30:29 +11:00
Andrew Tridgell 8b8029fdfe AP_Param: cope better with flooding the save queue with one param 2020-12-14 18:53:02 +11:00
Andrew Tridgell 5a8acea0dd AP_Param: fixed lockup in scripting due to save queue
this is a quick fix for a lockup in scripting due to the mission API
holding the scheduler semaphore when it is updating the mission count
parameter
2020-12-14 18:53:02 +11:00
bugobliterator 9acaa84b8f AP_Param: disable cmdline parameters for AP_Periph 2020-11-04 19:59:40 +11:00
Nick Exton 01155cc5d4 AP_Param: Ignore FORMAT_VERSION param when loading SITL defaults
This fixes a bug where having FORMAT_VERSION in the SITL defaults file
can result in an invalid SITL EEPROM file. See issue #15579 for details.
2020-10-20 10:30:17 +11:00
Pierre Kancir 420c9c9d36 AP_Param: use hal.util->set_cmdline_parameters() on SITL on reload_defaults_file()
This allow to pass cmdline parameter to Param on start for each vehicle in the same way as param file
2020-10-13 10:31:21 +11:00
Andy Piper 7aa98d55eb AP_Param: expose the stable key for use by AP_OSD
add support for finding parameters by name and returning the token
2020-09-09 20:36:42 +10:00
Randy Mackay 4009f1583f AP_Param: show_all compiler error fix 2020-08-10 19:26:20 +10:00
Andrew Tridgell db0d3c5e89 AP_Param: fixed race in param count handling 2020-04-29 07:36:55 +10:00
Andrew Tridgell 766fb32292 AP_Param: added set_enable() API
used to set value of an enable parameter, clearing count cache
2020-04-29 07:36:55 +10:00
Peter Barker b490f20f3d AP_Param: panic if defaults file load fails 2020-04-18 21:51:16 +10:00
Siddharth Purohit 1d2985e967 AP_Param: add method to find key of top level group variable by pointer 2020-02-19 13:59:53 +09:00
Peter Hall 5164eacc4a AP_Param: add get and set functions 2020-02-18 10:18:12 +11:00
Peter Hall 623c1aa3cd AP_Param: add singleton 2020-02-18 10:18:12 +11:00
Peter Hall 1ee14ffa75 AP_Param: use thread safe object buffer 2020-02-12 07:05:05 +11:00
Andrew Tridgell 7ef86c9bb1 AP_Param: added convert_parameter_width()
this allows for easy conversion of the width of a parameter without
changing indexes
2020-01-14 14:23:11 +11:00
Mark Whitehorn f8d4cba667 AP_Param: rename sensor_config_error to config_error 2019-11-08 10:14:34 +11:00
Andrew Tridgell 31b0663115 AP_Param: use strtof instead of atof
we don't need double precision
2019-10-28 15:53:16 +11:00
Andrew Tridgell 6573857a90 AP_Param: support @READONLY marker in param files
allows for read-only parameters embedded in firmware
2019-09-12 10:50:30 +10:00
Peter Barker ca5ee2bfbc AP_Param: correct fetching of flags for parameters
This was sending through the flags for the group the parameter was in,
rather than the parameter itself.
2019-08-30 06:57:30 +10:00
Peter Barker b493805fb4 AP_Param: methods to provide amount of parameter space used
AP_Param: provide method for storage size
2019-08-28 11:51:09 +10:00
Andrew Tridgell f897eae89d AP_Param: enable reduced size support for AP_Periph 2019-08-27 10:29:56 +10:00
Peter Barker 2049e86dda AP_Param: optionally return parameter flags in AP_Param::find(...) 2019-08-22 09:23:56 +10:00
Andrew Tridgell 2572885159 AP_Param: flush() after converting parameters
this prevents a race in sub where a set_default_by_name() directly
follows a parameter conversion for ARMING_CHECK. Without the flush the
default is written to storage by the IO queue draining after the set()
2019-07-30 10:42:16 +10:00
Michael du Breuil f06251a07f AP_Param: Delay param dumps to avoid running out of buffer space 2019-07-30 10:42:16 +10:00
murata 88c681586f AP_Param: Match output type and variable type 2019-07-16 10:11:13 +10:00
Michael du Breuil 40753ab14e AP_Param: Remove non functional AP_Param ignore flags 2019-06-11 10:28:45 +10:00
Peter Barker 0d1b7b90b9 AP_Param: avoid allocating 0 bytes if no defaults
This stopped CUAVv5 from booting.

Also add some protection against having different parsers for the same
file format used for counting parameters and actually using them.
2019-05-14 08:02:54 +10:00
Randy Mackay 94ee157575 AP_Param: set_defaults_from_table reports failure with sensor_config_error
replace panic and send_text with call to AP_BoardConfig::sensor_config_error to make it easier for users or developers to find the issue
2018-12-06 12:23:41 +09:00
Randy Mackay 98cd300885 AP_Param: add set_defaults_from_table 2018-12-06 12:23:41 +09:00
Michael du Breuil effdc436f2 AP_Param: Fix a mixture of new/free 2018-11-26 22:32:56 +00:00
Andrew Tridgell 4d662a913a AP_Param: use background parameter save
this moves both the storage scan and the save code out of the main
thread and into the IO thread. It means that if we have more than 30
parameters saves in very rapid succession while armed that we can lose
parameter changes, but that is extremely unlikely.

This fixes an issue where parameter saves in flight can cause
considerable scheduling problems, sometimes several milliseconds
2018-08-16 12:40:10 +10:00
Andrew Tridgell a9c570702c AP_Param: fixed build warning 2018-07-09 19:41:18 +10:00
Lucas De Marchi 1a45aa12f5 AP_Param: warn on last pass only about unknown parameters
Do not warn about unknown parameters on the first pass, i.e. when
AP_Param:load_all() is called. This is because we may still not know
about dynamically loaded parameters. When we call the second (last)
time, we expect to already know all possible parameters, so print a
warning to both console and the debug terminal.
2018-06-28 10:18:19 -07:00
Lucas De Marchi 7f0d5ddf21 AP_Param: stop panic()'ing on unknown parameters
Our track record on keeping parameters up to date with master is not
great and panic()'ing when loading them apparently is not helping
because every and each vehicle has a different file.

On aerofc load_defaults_file() is used in the same way as
load_embedded_param_defaults() is in which the panic() behavior has been
previously removed.

This finishes the removal of the panic param and add warnings to the
debug console when reading the parameters (rather than when counting
them).
2018-06-28 10:18:19 -07:00
Peter Barker 83b918f1c3 AP_Param: make send_parameter_value_all a GCS method rather than static 2018-05-01 09:39:01 +10:00
Peter Barker 32795f0a8f AP_Param: correct possible use of nullptr during param count
::first can return nullptr
2018-04-02 14:12:09 +09:00
Andrew Tridgell c6c5603382 AP_Param: added back key dumping code
this is essential for working out conversion tables.
2018-01-24 18:23:59 +11:00