AP_Param: added an initialised() method

this will be used by the compass code
This commit is contained in:
Andrew Tridgell 2012-02-17 15:12:48 +11:00
parent 677df0fe1c
commit 6f080742b8
2 changed files with 9 additions and 0 deletions

View File

@ -206,6 +206,12 @@ bool AP_Param::setup(const AP_Param::Info *info, uint8_t num_vars, uint16_t eepr
return true; return true;
} }
// check if AP_Param has been initialised
bool AP_Param::initialised(void)
{
return _var_info != NULL;
}
// find the info structure given a header and a group_info table // find the info structure given a header and a group_info table
// return the Info structure and a pointer to the variables storage // return the Info structure and a pointer to the variables storage
const struct AP_Param::Info *AP_Param::find_by_header_group(struct Param_header phdr, void **ptr, const struct AP_Param::Info *AP_Param::find_by_header_group(struct Param_header phdr, void **ptr,

View File

@ -80,6 +80,9 @@ public:
// wrong version is found // wrong version is found
static bool setup(const struct Info *info, uint8_t num_vars, uint16_t eeprom_size); static bool setup(const struct Info *info, uint8_t num_vars, uint16_t eeprom_size);
// return true if AP_Param has been initialised via setup()
static bool initialised(void);
/// Copy the variable's name, prefixed by any containing group name, to a buffer. /// Copy the variable's name, prefixed by any containing group name, to a buffer.
/// ///
/// If the variable has no name, the buffer will contain an empty string. /// If the variable has no name, the buffer will contain an empty string.