mirror of https://github.com/ArduPilot/ardupilot
AP_Proximity: fix fallthrough in proximity switch
in the case that cygbot was selected but not compiled in we would try to insantiate a DroneCAN backend
This commit is contained in:
parent
95354ac572
commit
4a29a57d8d
|
@ -173,8 +173,8 @@ void AP_Proximity::init()
|
|||
}
|
||||
break;
|
||||
|
||||
case Type::CYGBOT_D1:
|
||||
#if AP_PROXIMITY_CYGBOT_ENABLED
|
||||
case Type::CYGBOT_D1:
|
||||
if (AP_Proximity_Cygbot_D1::detect(serial_instance)) {
|
||||
state[instance].instance = instance;
|
||||
drivers[instance] = new AP_Proximity_Cygbot_D1(*this, state[instance], params[instance], serial_instance);
|
||||
|
|
|
@ -59,7 +59,9 @@ public:
|
|||
SITL = 10,
|
||||
AirSimSITL = 12,
|
||||
#endif
|
||||
#if AP_PROXIMITY_CYGBOT_ENABLED
|
||||
CYGBOT_D1 = 13,
|
||||
#endif
|
||||
DroneCAN = 14,
|
||||
};
|
||||
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
|
||||
#include "AP_Proximity.h"
|
||||
|
||||
#ifndef AP_PROXIMITY_CYGBOT_ENABLED
|
||||
#define AP_PROXIMITY_CYGBOT_ENABLED HAL_PROXIMITY_ENABLED
|
||||
#endif
|
||||
|
||||
#if (HAL_PROXIMITY_ENABLED && AP_PROXIMITY_CYGBOT_ENABLED)
|
||||
#include "AP_Proximity_Backend_Serial.h"
|
||||
|
||||
|
|
|
@ -5,3 +5,7 @@
|
|||
#ifndef HAL_PROXIMITY_ENABLED
|
||||
#define HAL_PROXIMITY_ENABLED (!HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
|
||||
#endif
|
||||
|
||||
#ifndef AP_PROXIMITY_CYGBOT_ENABLED
|
||||
#define AP_PROXIMITY_CYGBOT_ENABLED HAL_PROXIMITY_ENABLED
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue