mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-03 04:03:59 -04:00
AP_Compass: setup HIL/SITL for two compasses
This commit is contained in:
parent
ab687ab0f5
commit
2475ee9630
@ -51,7 +51,7 @@ bool
|
||||
AP_Compass_HIL::init(void)
|
||||
{
|
||||
// register two compass instances
|
||||
for (uint8_t i=0; i<COMPASS_MAX_INSTANCES; i++) {
|
||||
for (uint8_t i=0; i<HIL_NUM_COMPASSES; i++) {
|
||||
_compass_instance[i] = register_compass();
|
||||
}
|
||||
return true;
|
||||
|
@ -4,6 +4,12 @@
|
||||
|
||||
#include "Compass.h"
|
||||
|
||||
#if COMPASS_MAX_INSTANCES == 1
|
||||
# define HIL_NUM_COMPASSES 1
|
||||
#else
|
||||
# define HIL_NUM_COMPASSES 2
|
||||
#endif
|
||||
|
||||
class AP_Compass_HIL : public AP_Compass_Backend
|
||||
{
|
||||
public:
|
||||
@ -15,7 +21,7 @@ public:
|
||||
static AP_Compass_Backend *detect(Compass &compass);
|
||||
|
||||
private:
|
||||
uint8_t _compass_instance[COMPASS_MAX_INSTANCES];
|
||||
uint8_t _compass_instance[HIL_NUM_COMPASSES];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user