Compass: default device id to zero

This commit is contained in:
Randy Mackay 2014-07-10 15:35:40 +09:00
parent 16d4af8346
commit 4995b9ada8
1 changed files with 7 additions and 0 deletions

View File

@ -149,6 +149,13 @@ Compass::Compass(void) :
_null_init_done(false)
{
AP_Param::setup_object_defaults(this, var_info);
#if COMPASS_MAX_INSTANCES > 1
// default device ids to zero. init() method will overwrite with the actual device ids
for (uint8_t i; i<COMPASS_MAX_INSTANCES; i++) {
_dev_id[i] = 0;
}
#endif
}
// Default init method, just returns success.