AP_HAL: don't include Semaphore headers while building C source

This commit is contained in:
bugobliterator 2023-03-10 09:43:42 +11:00 committed by Andrew Tridgell
parent 24c5fe54df
commit 350f718745
4 changed files with 10 additions and 0 deletions

View File

@ -59,12 +59,14 @@
#define HAL_WITH_EKF_DOUBLE HAL_HAVE_HARDWARE_DOUBLE
#endif
#ifdef __cplusplus
// allow for static semaphores
#include <AP_HAL_ChibiOS/Semaphores.h>
#define HAL_Semaphore ChibiOS::Semaphore
#include <AP_HAL/EventHandle.h>
#define HAL_EventHandle AP_HAL::EventHandle
#endif
/* string names for well known SPI devices */
#define HAL_BARO_MS5611_NAME "ms5611"

View File

@ -23,9 +23,11 @@
#define O_CLOEXEC 0
#define HAL_STORAGE_SIZE (16384)
#ifdef __cplusplus
// allow for static semaphores
#include <AP_HAL_ESP32/Semaphores.h>
#define HAL_Semaphore ESP32::Semaphore
#endif
#define HAL_NUM_CAN_IFACES 0
#define HAL_MEM_CLASS HAL_MEM_CLASS_192

View File

@ -380,10 +380,13 @@
#define HAL_LINUX_I2C_EXTERNAL_BUS_MASK 0xFFFF
#endif
// only include if compiling C++ code
#ifdef __cplusplus
#include <AP_HAL_Linux/Semaphores.h>
#define HAL_Semaphore Linux::Semaphore
#include <AP_HAL/EventHandle.h>
#define HAL_EventHandle AP_HAL::EventHandle
#endif
#ifndef HAL_HAVE_HARDWARE_DOUBLE
#define HAL_HAVE_HARDWARE_DOUBLE 1

View File

@ -50,12 +50,15 @@
#define HAL_HAVE_SERVO_VOLTAGE 1
#define HAL_HAVE_SAFETY_SWITCH 0
// only include if compiling C++ code
#ifdef __cplusplus
// allow for static semaphores
#include <AP_HAL_SITL/Semaphores.h>
#define HAL_Semaphore HALSITL::Semaphore
#include <AP_HAL/EventHandle.h>
#define HAL_EventHandle AP_HAL::EventHandle
#endif
#ifndef HAL_NUM_CAN_IFACES
#define HAL_NUM_CAN_IFACES 0