Andrew Tridgell
ad2f6e1217
AP_Param: add support for converting between old and new parameters
...
this allows for a conversion table between old parameters and new
parameters, making firmware upgrades with moved parameters much easier
for users
12 years ago
Andrew Tridgell
813e767efb
AP_Param: use const refs in a few more places
...
reduces code size by a couple of hundred bytes
12 years ago
Andrew Tridgell
01a4fabf9e
AP_Param: make things a bit more efficient
12 years ago
Andrew Tridgell
9171d5587d
AP_Param: make it easier to show the value of a parameter
12 years ago
Andrew Tridgell
fa493a0fb3
AP_Param: added ops needed for ArduCopter build
12 years ago
tobias
fbe7daa477
AP_Param: fixed assignment handling and const
...
this fixes radio_min = radio_max = radio_trim = 0; in RC_Channel
12 years ago
Andrew Tridgell
7be1335b3a
AP_Param: removed copy_name() and add token to find_by_index()
...
this allows callers to avoid another var_info traverse
12 years ago
Andrew Tridgell
c8ae665ac3
AP_Param: added copy_name_token()
...
this avoids an expensive var_info traversal on every copy_name call
12 years ago
Andrew Tridgell
4764a03aaa
AP_Param: fixed ARM PX4 build
12 years ago
Andrew Tridgell
3a762f891e
AP_Param: fixup for ARM compiler
12 years ago
Andrew Tridgell
af12c18dea
AP_Param: setup var_info and num_vars earlier
...
needed for AP_HAL startup
12 years ago
Andrew Tridgell
95d4cc2ce9
AP_Param: change method of loading defaults
...
this avoids a dependency on the constructor ordering by loading
defaults for each object separately
12 years ago
Pat Hickey
c4dbe8c627
AP_Param: move from AP_Common to its own library
12 years ago
Andrew Tridgell
b0713ba412
AP_Param: support up to 16 character parameter names
...
MAVLink allows for 16 chars, with no null termination if all 16 are
used
12 years ago
Andrew Tridgell
ef919c4e36
AP_Param: fixed a bug with setting nested parameters
...
This bug meant that setting a parameter in a parent class for a doubly
nested parameter group, where the parameter index in the parent class
is 4 or greater would actually set the first element in that parent
class.
At the moment only one parameter fits these narrow constraints - the
RCn_DZ element of the RC_Channel_aux class. So if someone set RC5_DZ
to 17 in ArduPlane it would actually set RC5_MIN to 17.
12 years ago
Andrew Tridgell
e761645e24
AP_Param: added find_by_index()
13 years ago
Pat Hickey
42e24a869f
uncrustify libraries/AP_Common/AP_Param.h with fixups by hand
13 years ago
Andrew Tridgell
7f4b7703c1
AP_Param: fixed some build warnings
13 years ago
Andrew Tridgell
c298d5130f
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.
13 years ago
Andrew Tridgell
e1725e9ea5
AP_Param: added some docs on the eeprom header format
13 years ago
Amilcar Lucas
6e9ffb4249
correct small typos in comments
13 years ago
Andrew Tridgell
f4329d2680
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
13 years ago
Pat Hickey
eac8b66385
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
13 years ago
Andrew Tridgell
fa443bd928
AP_Param: make the templating code a bit clearer
...
add comments on the arguments, and name them in a clearer way
13 years ago
Andrew Tridgell
2e9105c68a
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
13 years ago
Andrew Tridgell
53b87229ff
AP_Param: added ParamToken type for variable list traversal
13 years ago
Andrew Tridgell
882cd4ea83
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
13 years ago
Andrew Tridgell
4b15b63d21
AP_Param: fixed copy-assignment operators for AP_Param vectors
13 years ago
Andrew Tridgell
7f3858cb7f
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
13 years ago
Andrew Tridgell
80a6773b8b
AP_Param: added an initialised() method
...
this will be used by the compass code
13 years ago
Andrew Tridgell
d55a0c3a71
added AP_Param::show_all()
...
this moves the logic into common code
13 years ago
Andrew Tridgell
9175ebe33a
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.
13 years ago
Andrew Tridgell
f2a6a31645
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
13 years ago
Andrew Tridgell
678a1df3be
fixed support for AP_PARAM_SPARE
...
spare group elements are needed if we remove a group parameter
13 years ago
Andrew Tridgell
95e107ab75
AP_Param: added generic cast_to_float
13 years ago
Andrew Tridgell
e8c4ecf9fa
added nested group support and validation
13 years ago
Andrew Tridgell
5b842a447f
new AP_Param subsystem
13 years ago