mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
pios: common PIOS #ifdef guards
Conflicts: flight/PiOS/Common/pios_com.c flight/PiOS/Common/pios_mpu6000.c
This commit is contained in:
parent
e96f717b94
commit
285cad290b
@ -30,6 +30,8 @@
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_ADXL345
|
||||
|
||||
enum pios_adxl345_dev_magic {
|
||||
PIOS_ADXL345_DEV_MAGIC = 0xcb55aa55,
|
||||
};
|
||||
@ -306,3 +308,5 @@ uint8_t PIOS_ADXL345_Read(struct pios_adxl345_data * data)
|
||||
|
||||
return rec[8] & 0x7F; // return number of remaining entries
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_ADXL345 */
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_BMA180)
|
||||
#ifdef PIOS_INCLUDE_BMA180
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
|
||||
@ -475,6 +475,7 @@ bool PIOS_BMA180_IRQHandler(void)
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_BMA180 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
@ -28,15 +28,13 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_BMP085)
|
||||
#if !defined(PIOS_INCLUDE_EXTI)
|
||||
#error PIOS_EXTI Must be included in the project!
|
||||
#endif /* PIOS_INCLUDE_EXTI */
|
||||
#ifdef PIOS_INCLUDE_BMP085
|
||||
|
||||
#include <pios_exti.h>
|
||||
#ifndef PIOS_INCLUDE_EXTI
|
||||
#error PIOS_EXTI must be included in the project
|
||||
#endif /* PIOS_INCLUDE_EXTI */
|
||||
|
||||
/* Glocal Variables */
|
||||
ConversionTypeTypeDef CurrentRead;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <pios.h>
|
||||
#include <pios_board.h>
|
||||
|
||||
#include "pios_board_info.h"
|
||||
|
||||
const struct pios_board_info __attribute__((__used__)) __attribute__((__section__(".boardinfo"))) pios_board_info_blob = {
|
||||
|
@ -28,15 +28,14 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_COM)
|
||||
#ifdef PIOS_INCLUDE_COM
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
#include <pios_com_priv.h>
|
||||
|
||||
#if !defined(PIOS_INCLUDE_FREERTOS)
|
||||
#ifndef PIOS_INCLUDE_FREERTOS
|
||||
#include "pios_delay.h" /* PIOS_DELAY_WaitmS */
|
||||
#endif
|
||||
|
||||
@ -524,7 +523,7 @@ bool PIOS_COM_Available(uint32_t com_id)
|
||||
return (com_dev->driver->available)(com_dev->lower_id);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_COM */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -28,10 +28,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_COM_MSG)
|
||||
#ifdef PIOS_INCLUDE_COM_MSG
|
||||
|
||||
#include "pios_com.h"
|
||||
|
||||
|
@ -28,12 +28,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_ETASV3)
|
||||
|
||||
#include "pios_etasv3.h"
|
||||
#ifdef PIOS_INCLUDE_ETASV3
|
||||
|
||||
static bool PIOS_ETASV3_Read(uint8_t * buffer, uint8_t len)
|
||||
{
|
||||
|
@ -28,7 +28,11 @@
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_FLASH
|
||||
|
||||
#include "pios_flash_jedec_priv.h"
|
||||
|
||||
#define JEDEC_WRITE_ENABLE 0x06
|
||||
@ -562,3 +566,4 @@ const struct pios_flash_driver pios_jedec_flash_driver = {
|
||||
.read_data = PIOS_Flash_Jedec_ReadData,
|
||||
};
|
||||
|
||||
#endif /* PIOS_INCLUDE_FLASH */
|
||||
|
@ -24,6 +24,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_FLASH
|
||||
|
||||
#include "openpilot.h"
|
||||
|
||||
#include "pios_flashfs_logfs_priv.h"
|
||||
@ -1020,6 +1025,8 @@ out_exit:
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_FLASH */
|
||||
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
@ -28,12 +28,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#include "uavobjectmanager.h"
|
||||
#ifdef PIOS_INCLUDE_GCSRCVR
|
||||
|
||||
#if defined(PIOS_INCLUDE_GCSRCVR)
|
||||
#include "uavobjectmanager.h"
|
||||
|
||||
#include "pios_gcsrcvr_priv.h"
|
||||
|
||||
@ -168,7 +167,7 @@ static void PIOS_gcsrcvr_Supervisor(uint32_t gcsrcvr_id) {
|
||||
gcsrcvr_dev->Fresh = false;
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_GCSRCVR */
|
||||
#endif /* PIOS_INCLUDE_GCSRCVR */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -28,12 +28,12 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_HCSR04)
|
||||
#ifdef PIOS_INCLUDE_HCSR04
|
||||
|
||||
#if !(defined(PIOS_INCLUDE_DSM) || defined(PIOS_INCLUDE_SBUS))
|
||||
#error Only supported with Spektrum/JR DSM or S.Bus interface!
|
||||
#error Only supported with Spektrum/JR DSM or S.Bus interface
|
||||
#endif
|
||||
|
||||
/* Local Variables */
|
||||
@ -206,5 +206,5 @@ void TIM3_IRQHandler(void)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_HCSR04 */
|
||||
|
||||
#endif
|
||||
|
@ -29,10 +29,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_HMC5843)
|
||||
#ifdef PIOS_INCLUDE_HMC5843
|
||||
|
||||
#include <pios_exti.h>
|
||||
|
||||
@ -376,7 +375,7 @@ static bool PIOS_HMC5843_Write(uint8_t address, uint8_t buffer)
|
||||
return PIOS_I2C_Transfer(PIOS_I2C_MAIN_ADAPTER, txn_list, NELEMENTS(txn_list));
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_HMC5843 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -28,10 +28,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_HMC5883)
|
||||
#ifdef PIOS_INCLUDE_HMC5883
|
||||
|
||||
/* Global Variables */
|
||||
|
||||
|
@ -29,12 +29,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_I2C_ESC)
|
||||
#ifdef PIOS_INCLUDE_I2C_ESC
|
||||
|
||||
/* HMC5843 Addresses */
|
||||
/* Known i2c ESC addresses */
|
||||
#define MK_I2C_ADDR 0x29
|
||||
#define ASTEC4_I2C_ADDR 0x02
|
||||
|
||||
@ -164,7 +163,7 @@ bool PIOS_SetAstec4Speed(uint8_t motornum, uint8_t speed) {
|
||||
return PIOS_I2C_Transfer(PIOS_I2C_ESC_ADAPTER, txn_list, NELEMENTS(txn_list));
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_I2C_ESC */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -29,10 +29,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_L3GD20)
|
||||
#ifdef PIOS_INCLUDE_L3GD20
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
|
||||
@ -381,7 +380,7 @@ bool PIOS_L3GD20_IRQHandler(void)
|
||||
return xHigherPriorityTaskWoken == pdTRUE;
|
||||
}
|
||||
|
||||
#endif /* L3GD20 */
|
||||
#endif /* PIOS_INCLUDE_L3GD20 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -29,9 +29,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
#if defined(PIOS_INCLUDE_MPU6000)
|
||||
|
||||
#ifdef PIOS_INCLUDE_MPU6000
|
||||
|
||||
#include "fifo_buffer.h"
|
||||
|
||||
@ -551,7 +551,7 @@ bool PIOS_MPU6000_IRQHandler(void)
|
||||
return xHigherPriorityTaskWoken == pdTRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_MPU6000 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -30,10 +30,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_MPXV)
|
||||
#ifdef PIOS_INCLUDE_MPXV
|
||||
|
||||
#define A0 340.27f //speed of sound at standard sea level in [m/s]
|
||||
#define P0 101.325f //static air pressure at standard sea level in kPa
|
||||
|
@ -28,13 +28,14 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_MS5611
|
||||
|
||||
|
||||
// TODO: Clean this up. Getting around old constant.
|
||||
#define PIOS_MS5611_OVERSAMPLING oversampling
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_MS5611)
|
||||
|
||||
/* Glocal Variables */
|
||||
ConversionTypeTypeDef CurrentRead;
|
||||
@ -261,7 +262,7 @@ int32_t PIOS_MS5611_Test()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_MS5611 */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_RCVR)
|
||||
#ifdef PIOS_INCLUDE_RCVR
|
||||
|
||||
#include <pios_rcvr_priv.h>
|
||||
|
||||
@ -108,7 +107,7 @@ int32_t PIOS_RCVR_Read(uint32_t rcvr_id, uint8_t channel)
|
||||
return rcvr_dev->driver->read(rcvr_dev->lower_id, channel);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_RCVR */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -46,10 +46,9 @@
|
||||
//
|
||||
// *****************************************************************
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_RFM22B)
|
||||
#ifdef PIOS_INCLUDE_RFM22B
|
||||
|
||||
#include <pios_spi_priv.h>
|
||||
#include <packet_handler.h>
|
||||
@ -2455,7 +2454,7 @@ static enum pios_rfm22b_event rfm22_fatal_error(struct pios_rfm22b_dev *rfm22b_d
|
||||
|
||||
// ************************************
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_RFM22B */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -28,11 +28,11 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
#include "pios_sbus_priv.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_SBUS)
|
||||
#ifdef PIOS_INCLUDE_SBUS
|
||||
|
||||
#include "pios_sbus_priv.h"
|
||||
|
||||
/* Forward Declarations */
|
||||
static int32_t PIOS_SBus_Get(uint32_t rcvr_id, uint8_t channel);
|
||||
@ -332,7 +332,7 @@ static void PIOS_SBus_Supervisor(uint32_t sbus_id)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_SBUS */
|
||||
#endif /* PIOS_INCLUDE_SBUS */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -29,10 +29,9 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/* Project Includes */
|
||||
#include "pios.h"
|
||||
|
||||
#if defined(PIOS_INCLUDE_SDCARD)
|
||||
#ifdef PIOS_INCLUDE_SDCARD
|
||||
|
||||
/* Global Variables */
|
||||
VOLINFO PIOS_SDCARD_VolInfo;
|
||||
@ -1000,7 +999,7 @@ int32_t PIOS_SDCARD_FileDelete(char *Filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* PIOS_INCLUDE_SDCARD */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
@ -28,6 +28,10 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_USB
|
||||
|
||||
#include "pios_usb_desc_hid_cdc_priv.h" /* exported API */
|
||||
#include "pios_usb_defs.h" /* struct usb_*, USB_* */
|
||||
#include "pios_usb_board_data.h" /* PIOS_USB_BOARD_* */
|
||||
@ -324,3 +328,5 @@ int32_t PIOS_USB_DESC_HID_CDC_Init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_USB */
|
||||
|
@ -28,6 +28,10 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_USB
|
||||
|
||||
#include "pios_usb_desc_hid_only_priv.h" /* exported API */
|
||||
#include "pios_usb_defs.h" /* struct usb_*, USB_* */
|
||||
#include "pios_usb_board_data.h" /* PIOS_USB_BOARD_* */
|
||||
@ -163,3 +167,5 @@ int32_t PIOS_USB_DESC_HID_ONLY_Init(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_USB */
|
||||
|
@ -28,6 +28,10 @@
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "pios.h"
|
||||
|
||||
#ifdef PIOS_INCLUDE_USB
|
||||
|
||||
#include "pios_usb_util.h"
|
||||
|
||||
uint8_t * PIOS_USB_UTIL_AsciiToUtf8(uint8_t * dst, uint8_t * src, uint16_t srclen)
|
||||
@ -40,3 +44,5 @@ uint8_t * PIOS_USB_UTIL_AsciiToUtf8(uint8_t * dst, uint8_t * src, uint16_t srcle
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif /* PIOS_INCLUDE_USB */
|
||||
|
@ -30,7 +30,8 @@
|
||||
*/
|
||||
|
||||
#include "pios.h"
|
||||
#if defined(PIOS_INCLUDE_VIDEO)
|
||||
|
||||
#ifdef PIOS_INCLUDE_VIDEO
|
||||
|
||||
extern xSemaphoreHandle osdSemaphore;
|
||||
|
||||
@ -277,7 +278,4 @@ void PIOS_VIDEO_DMA_Handler(void)
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* PIOS_INCLUDE_VIDEO */
|
||||
|
@ -30,7 +30,8 @@
|
||||
*/
|
||||
|
||||
#include "pios.h"
|
||||
#if defined(PIOS_INCLUDE_WAVE)
|
||||
|
||||
#ifdef PIOS_INCLUDE_WAVE
|
||||
|
||||
static const struct pios_dac_cfg * dev_cfg;
|
||||
|
||||
@ -606,7 +607,4 @@ void DAC_DMA_Handler(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* PIOS_INCLUDE_WAVE */
|
||||
|
Loading…
Reference in New Issue
Block a user