Commit Graph

137 Commits

Author SHA1 Message Date
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 2ccb9061d9 AP_Param: minor format fixes 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
Michael du Breuil a1a5665213 AP_Param: Support marking a param group as ignoring the enable flag 2018-01-17 22:21:55 +00:00
Andrew Tridgell 51512ed7c0 AP_Param: don't panic on bad embedded parameters
this makes life much easier for vendors
2018-01-15 11:46:02 +11:00
Andrew Tridgell d0d6040b3e AP_Param: use wider range of sentinal values
this copes better with power off while writing parameters
2018-01-15 11:46:02 +11:00
Andrew Tridgell 4ac49483c8 AP_Param: added support for embedded parameters
use a block of flash to hold embedded parameters that can be changed
using apj_tool.py
2017-12-18 11:14:59 +11:00
Jacob Walser d5896287b7 AP_Param: Add set_by_name and set_and_save_by_name helpers 2017-10-25 21:07:09 +11:00
Peter Barker e3599ab4f9 AP_Param: remove CLI 2017-08-14 10:23:50 +09:00
Michael du Breuil 8de96ee4a1 AP_Param: Check for duplicate group id's before handling groups 2017-07-17 08:43:50 -07:00
Andrew Tridgell 7e24be95c9 AP_Param: added macro for var table extension in object 2017-05-03 20:12:04 +10:00
Andrew Tridgell 60e4c0eb98 AP_Param: make count_parameters() thread safe 2017-05-01 14:36:10 +10:00
Andrew Tridgell 47803e73e4 AP_Param: allow for dynamic var_info tables
this allows the var_info entry in a table to be a constant pointer,
allowing the selection of a type for a parameter class at runtime.
2017-03-25 16:22:10 +11:00
Peter Barker c93942695f AP_Param: load parameters from a comma-separated-list
This patch will break things for anyone who is using
a comma in their filenames for their ardupilot defaults
files.
2017-02-23 22:46:33 -08:00
Peter Barker fe189fefbc AP_Param: Factor load_defaults_file (NFC) 2017-02-23 22:46:33 -08:00
Andrew Tridgell 79b0c856b2 AP_Param: added support for frame specific parameters
this allows for libraries that have parameters that are only activated
on particular frame types
2017-02-14 19:49:29 +11:00
Lucas De Marchi 85eadca7ad AP_Param: shut up float comparison warning
We want to compare the value previously set in memory.
2017-02-06 09:27:22 -08:00
murata 59454b0c6f AP_Param: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Andrew Tridgell 4687785185 AP_Param: fixed a bug in default file handling
this fixes a bug in how default file values are handled that affects
any common sub-objects. When we had a default value for something like
SERVO12_FUNCTION then configured_in_defaults_file() would return true
for SERVO1_FUNCTION as it shares a common default value pointer

this changes the implementation to use the object pointer instead
2017-01-24 09:50:25 +11:00
Peter Barker a481e52861 AP_Param: make configured() const 2017-01-20 13:02:53 +09:00
Pierre Kancir 5aa4bc4368 AP_Params: fix seg fault in debug function
otherwise at start, when loading paramter is could fail at AP_Param.cpp:611, Debug("scan past end of eeprom")"
2017-01-13 08:54:20 -08:00
Andrew Tridgell d005cbffd8 AP_Param: added convert_parent_class() 2017-01-12 17:39:37 +11:00
Andrew Tridgell 05e9462a9c AP_Param: added CONVERT_FLAG_REVERSE and CONVERT_FLAG_FORCE 2017-01-12 17:39:37 +11:00
Andrew Tridgell d430cd62a6 AP_Param: fixed loading defaults file after storage
make sure defaults don't override storage values
2017-01-12 17:39:37 +11:00
Andrew Tridgell 0c32178d07 AP_Param: added reload_defaults_file()
this allows defaults to be set for parameters in pointer objects
2017-01-12 17:39:37 +11:00
Andrew Tridgell 0d6801fbe6 AP_Param: added find_old_parameter() method
allows for custom conversion of parameters
2016-12-31 10:55:59 +09:00
Andrew Tridgell be9ac273ce AP_Param: apply notify check to AP_ParamV too
thanks to Francisco
2016-12-09 14:36:01 -08:00
Andrew Tridgell eaa68f32e3 AP_Param: avoid a notify if value is already correct 2016-12-09 14:36:01 -08:00
Francisco Ferreira a3fcebc501 AP_Param: add set_and_notify to vectors 2016-11-15 11:42:54 -08:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Peter Barker 2bd13af43d AP_Param: unhide groups when generating parameters in autotest 2016-10-26 09:53:14 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 68f0777dac AP_Param: fixed bug with deeply nested parameter trees
enumeration could loop forever if the IDs overlapped due to 8 bit
masking
2016-10-23 15:27:42 +11:00
Lucas De Marchi e6d5bac527 AP_Param: don't used reserved word in macros
`class` is a reserved word and should not be used as macro arguments.
It's very common in C++ to use "clazz" instead in these cases.
2016-10-15 15:19:17 -03:00
Andy Little 0d113b265c Examples: fix examples for px4
The change to use AP_BoardConfig messed up the examples. Here are some
updated but there are plenty more to do.
2016-10-04 12:50:47 -03:00
Andrew Tridgell a071fa3921 AP_Param: display defaults path on startup 2016-06-30 14:16:52 +10:00
Andrew Tridgell 1581a5e354 AP_Param: fixed forced save of constructor override parameters
this fixes the problem where setting ATC_RAT_YAW_FILT to 20 in copter
didn't stick across reboots
2016-05-24 16:55:45 +10:00
Francisco Ferreira af6d8e3c36 AP_Param: explicitly cast to float to avoid Clang warning
/home/travis/build/ArduPilot/ardupilot/libraries/AP_Param/AP_Param.h:542:22: warning: using floating point absolute value function 'fabsf' when argument is of integer type [-Wabsolute-value]
        bool force = fabsf(_value - v) < FLT_EPSILON;
2016-04-22 17:33:06 +01:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Andrew Tridgell 86416e8f05 AP_Param: added set_default_by_name() 2016-04-01 16:39:51 +11:00