Skip to content

Commit

Permalink
AP_Vehicle: correct compilation when AP_Vehicle not available
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Dec 13, 2023
1 parent 0f4262d commit 8e1fc60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/AP_Vehicle/AP_Vehicle.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include "AP_Vehicle_config.h"

#if AP_VEHICLE_ENABLED

#include "AP_Vehicle.h"

#include <AP_BLHeli/AP_BLHeli.h>
Expand Down Expand Up @@ -1029,3 +1033,4 @@ AP_Vehicle *vehicle()

};

#endif // AP_VEHICLE_ENABLED
6 changes: 6 additions & 0 deletions libraries/AP_Vehicle/AP_Vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
*/
#pragma once

#include "AP_Vehicle_config.h"

#if AP_VEHICLE_ENABLED

/*
this header holds a parameter structure for each vehicle type for
parameters needed by multiple libraries
Expand Down Expand Up @@ -490,3 +494,5 @@ extern const AP_HAL::HAL& hal;
extern const AP_Param::Info vehicle_var_info[];

#include "AP_Vehicle_Type.h"

#endif // AP_VEHICLE_ENABLED
5 changes: 5 additions & 0 deletions libraries/AP_Vehicle/AP_Vehicle_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

#ifndef AP_VEHICLE_ENABLED
#define AP_VEHICLE_ENABLED 1
#endif

0 comments on commit 8e1fc60

Please sign in to comment.