Commit Graph

21 Commits

Author SHA1 Message Date
Pat Hickey b78c1b21a7 uncrustify libraries/AP_Common/AP_Param.h with fixups by hand 2012-08-21 19:00:51 -07:00
Andrew Tridgell 73d70354a3 AP_Param: fixed some build warnings 2012-08-09 16:18:53 +10:00
Andrew Tridgell 45c7c9b8d1 AP_Param: major update to use default values in var_info table
this stores the default value for all scalar variables in the var_info
table, which makes it possible to avoid storing default values in
eeprom. That allows us to oversubscribe the eeprom space with a much
lower risk of overrun.
2012-08-08 12:11:57 +10:00
Andrew Tridgell 2bc530d04f AP_Param: added some docs on the eeprom header format 2012-07-10 14:03:49 +10:00
Amilcar Lucas a203282779 correct small typos in comments 2012-03-11 21:30:09 +01:00
Andrew Tridgell f1a389fe19 AP_Param: ensure we can't have duplicate keys in Parameters.h
this is O(n^2), but only at startup, and takes less than 1ms to run.
It catches a very nasty coding error
2012-03-02 15:48:28 +11:00
Pat Hickey 42078f2794 AP_Param: Make nested group recursion disableable by macro
* Eliminates recursive calls inside AP_Param.
  This is important to Pat @ Galois, but not the project in general.
  Recursion depth on these functions is bounded structurally using
  existing nested group constructors (can't create loops in finite space)
  and checked at init time
2012-02-28 16:28:27 -08:00
Andrew Tridgell 7fe4a41c31 AP_Param: make the templating code a bit clearer
add comments on the arguments, and name them in a clearer way
2012-02-27 10:54:33 +11:00
Andrew Tridgell 007a6b8958 AP_Param: added special handling for Vector3f
We would like to be able to use Vector3f as a parameter while exposing
the individual elements of the vector as MAVLink parameters. This
change to AP_Param makes that possible, by giving AP_Vector3f a dual
personality
2012-02-25 11:37:20 +11:00
Andrew Tridgell f30c721886 AP_Param: added ParamToken type for variable list traversal 2012-02-19 17:05:28 +11:00
Andrew Tridgell 2b8f0c3a48 AP_Param: moved AP_Vector3f and AP_Matrix3f declarations to AP_Math.h
this avoids us needing AP_Math.h in every utility sketch and example
2012-02-18 10:51:57 +11:00
Andrew Tridgell 70a135c47c AP_Param: fixed copy-assignment operators for AP_Param vectors 2012-02-18 10:51:57 +11:00
Andrew Tridgell e656928c01 AP_Param: added a set_and_save_ifchanged() method
this can be used to avoid the scan() in more frequenctly saved
variables, such as the MAVLink stream rates in APM
2012-02-18 10:51:57 +11:00
Andrew Tridgell 6f080742b8 AP_Param: added an initialised() method
this will be used by the compass code
2012-02-18 10:51:57 +11:00
Andrew Tridgell 16a5b5c3ee added AP_Param::show_all()
this moves the logic into common code
2012-02-13 16:22:52 +11:00
Andrew Tridgell ee2cb32a44 change back to 256 max variables in _var_info[]
this keeps the header to 24 bits, and allows the token to be 16
bits. If we need more variables we can put them in a nested group.
2012-02-13 16:22:52 +11:00
Andrew Tridgell 7621b96a52 AP_Param: added group idx, and change packing of header elements
adding a idx element to the GroupInfo will make it less likely that a
developer will change the IDs of group elements, and make it easier to
see that these IDs are important for identifying a variable in EEPROM

The header packing has changed to make it 24 bits on all platforms,
which allows us to lower the EEPROM variable max size to 1024 bytes
again
2012-02-13 16:22:52 +11:00
Andrew Tridgell 711cee9dfa fixed support for AP_PARAM_SPARE
spare group elements are needed if we remove a group parameter
2012-02-13 16:22:52 +11:00
Andrew Tridgell 34bc88eab5 AP_Param: added generic cast_to_float 2012-02-13 16:22:51 +11:00
Andrew Tridgell b6ee5ca982 added nested group support and validation 2012-02-13 16:22:51 +11:00
Andrew Tridgell 937f8a4741 new AP_Param subsystem 2012-02-13 16:22:50 +11:00