Commit Graph

86 Commits

Author SHA1 Message Date
Andrew Tridgell 7d92202db9 AP_Param: save flash space for parameter strings
now that we no longer need AVR support we can use nul terminated
strings for parameter names, saving a couple of k of flash space
2016-03-18 13:03:18 +11:00
Andrew Tridgell 018c7425a4 AP_Param: added AP_PARAM_NO_SHIFT
used for cases where we know the shift is not needed
2016-03-18 12:33:16 +11:00
Andrew Tridgell 71b6d3e33d AP_Param: add in nested group offset in load for conversion 2016-03-18 10:04:56 +11:00
Randy Mackay c15fa950c0 AP_Param: convert_old_parameter becomes public and accepts scaling 2016-03-18 10:04:55 +11:00
Andrew Tridgell 12067b27b3 AP_Param: cope with multi-level nesting and zero-idx
this copes properly with multi-level nesting of groups, and fixes an
issue with an idx of zero in nested groups
2016-03-18 10:04:55 +11:00
Andrew Tridgell ff04871fc5 AP_Param: fixed a reporting problem with AP_Vector3f
if we load an element other than the X element of a Vector3f via
MAVLink then the value reported back to the GCS would be at the wrong
offset in memory. This led to some very confusing results for users
2016-03-16 17:03:30 +11:00
Julien Beraud c2db6bfb9d AP_Param: Fix warning
Cast to the original type to use get function.
Still a hack but better than casting a pointer to an object which
memory mapping we are not supposed to know
2016-02-15 15:48:35 -02:00
Andrew Tridgell b54bb757df AP_Param: fixed flymaple build 2016-01-08 10:33:45 +11:00
Andrew Tridgell 415d800957 AP_Param: use get_custom_defaults_file() 2016-01-07 09:09:54 +11:00
Andrew Tridgell 93f0707679 AP_Param: added count_parameters() API
this auto-clears when an ENABLE parameter changes
2016-01-06 14:44:34 +11:00
Andrew Tridgell 224b2e2dda AP_Param: allow group entries as duplicates
otherwise this breaks heli attitude control object
2016-01-05 07:50:23 +11:00
Andrew Tridgell ac64effc74 AP_Param: allow group entries in any order
this will make the ENABLE flag more useful
2016-01-04 11:14:43 +11:00
Andrew Tridgell 57f580fdfc AP_Param: enable param debug by default 2016-01-04 11:14:43 +11:00
Andrew Tridgell 1b8cf84801 AP_Param: allow for up to 512 top level vehicle parameters
this will make life a bit easier for copter
2016-01-04 11:14:43 +11:00
Andrew Tridgell 29cb0dcf2c AP_Param: enable variables to be marked as enable variables
used to hide unused subtrees of variables
2016-01-04 11:14:42 +11:00
Andrew Tridgell 37b2e23322 AP_Param: allow objects containing parameters to be dynamically loaded
this makes it possible for objects containing parameters to be
dynamically loaded.
2016-01-04 11:14:42 +11:00
Andrew Tridgell 8e4586b4a2 AP_Param: allow for nested groups without subclassing
this allows for param tables containing other unrelated objects
2015-12-31 15:30:31 +09:00
Lucas De Marchi 52ef8c10a5 AP_Param: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Jonathan Challinger bde9a9421d AP_Param: panic on failure to load defaults file 2015-12-24 14:40:00 +11:00
Andrew Tridgell e873ff1e5f AP_Param: copter with vectors when sending parameters 2015-11-09 14:28:20 +11:00
Peter Barker 5f9b1c5f4e AP_Param: provide facility to notify GCS of param set 2015-11-09 09:23:20 +11:00
Peter Barker 046b008889 AP_Param: send saved param values to all GCS 2015-11-09 09:23:20 +11:00
Lucas De Marchi 68bef1ec64 AP_Param: fix wrong printf format for printf
"%S" is used for wide string, but we are passing a char*. Use lowercase
in this case to remove warnings like this:

libraries/AP_InertialSensor/AP_InertialSensor.cpp: In member function
'bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract*, float&, float&)':
libraries/AP_InertialSensor/AP_InertialSensor.cpp:620:61: warning:
format '%S' expects argument of type 'wchar_t*', but argument 3 has type 'const char*' [-Wformat=]
                 "Place vehicle %S and press any key.\n", msg);
                                                             ^
2015-10-30 14:35:45 +09:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi 1b07dabeb7 Replace prog_char and prog_char_t with char
prog_char and prog_char_t are now the same as char on supported
platforms. So, just change all places that use them and prefer char
instead.

AVR-specific places were not changed.
2015-10-30 14:35:30 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi 6f4904189b Replace use of println_P() with println() 2015-10-30 14:35:22 +09:00
Lucas De Marchi 65e719ccc3 AP_Param: replace find_P() with find() 2015-10-30 14:35:19 +09:00
Lucas De Marchi d595e41003 Replace use of strncmp_P() with strncmp() 2015-10-30 14:35:14 +09:00
Lucas De Marchi 0aa117f65d Replace use of strnlen_P() with strnlen() 2015-10-30 14:35:13 +09:00
Lucas De Marchi 1336d621be Replace use of strcpy_P() with strcpy() 2015-10-30 14:35:12 +09:00
Lucas De Marchi f8f3f5a024 Replace use of strlen_P() with strlen() 2015-10-30 14:35:10 +09:00
Lucas De Marchi 6f0db45b57 Replace use of strcasecmp_P() with strcasecmp() 2015-10-30 14:35:08 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Jonathan Challinger 39246c13ad AP_Param: add set_default, configured 2015-10-26 11:15:54 +11:00
Grant Morphett ab35ac41a5 AP_Param: Add parameter to print out all the keys/indexes
For some debugging I was working on I needed to see all the token
indexs and group elements.
2015-09-02 11:12:31 +10:00
Lucas De Marchi fa060a6124 AP_Param: add missing header StorageManager.h 2015-08-18 17:19:14 +10:00
Gustavo Jose de Sousa 159c5b8b44 AP_Param: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:22 +10:00
Andrew Tridgell 269f1fd99a AP_Param: replaced set_param_by_name with set_float
read for bugfix in GCS_MAVLink
2015-08-10 17:25:29 +10:00
tcr3dr 41e4c2720d AP_Param: Explicitly casts AP_CLASSTYPE parameter. 2015-07-01 11:32:11 +10:00
Andrew Tridgell 367a87591a AP_Param: fixed build of eedump_apparam 2015-06-03 11:46:00 +10:00
Andrew Tridgell 8454246fae AP_Param: make it safe to change the type of a parameter
if the type is changed then the value will revert to its default value
2015-05-27 15:29:40 +10:00
Andrew Tridgell fb97c16a84 AP_Param: make data pointer const 2015-05-21 07:48:52 +10:00
Andrew Tridgell 88fb7ddff8 AP_Param: fixed PSTR() usage 2015-05-05 13:54:15 +10:00
Andrew Tridgell bcc6c7d380 AP_Param: revert AP_Math class change 2015-05-05 13:27:07 +10:00
Tom Pittenger bfd1b2b11a AP_Param: compile warnings: format not a string literal, argument types not checked 2015-05-05 13:27:01 +10:00
Tom Pittenger b9771ca37c AP_Param: compile warnings: float to double. print statements require doubles 2015-05-05 13:27:00 +10:00
Tom Pittenger 440438fdda AP_Param: compiler warnings: apply is_zero(float) or is_equal(float)
due to an include cross-dependency between ap_param and ap_math, I punted and reimplemented is_equal() for this one function in the header
2015-05-05 13:26:58 +10:00
Tom Pittenger 66ddfdeae6 AP_Param: fix compile warnings re float constants 2015-04-24 14:04:04 +09:00
Andrew Tridgell 5a755c0400 AP_Param: allow a HAL_PARAM_DEFAULTS_PATH to override defaults
this allows a HAL_PARAM_DEFAULTS_PATH to be specified for a build to
override the default parameters for a build. This is useful to build a
firmware that has different default parameters
2015-04-04 09:01:40 -07:00