1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

pios: STM32F4xx PIOS #ifdef guards

This commit is contained in:
Oleg Semyonov 2013-03-15 20:42:54 +02:00
parent b73ddffbf0
commit e80890e164
25 changed files with 77 additions and 65 deletions

View File

@ -43,9 +43,11 @@
*/
#include "pios.h"
#ifdef PIOS_INCLUDE_ADC
#include <pios_adc_priv.h>
#if defined(PIOS_INCLUDE_ADC)
#if !defined(PIOS_ADC_MAX_SAMPLES)
#define PIOS_ADC_MAX_SAMPLES 0

View File

@ -28,9 +28,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_BL_HELPER)
#ifdef PIOS_INCLUDE_BL_HELPER
#include <pios_board_info.h>
#include "stm32f4xx_flash.h"
#include <stdbool.h>
@ -192,4 +193,5 @@ void PIOS_BL_HELPER_FLASH_Read_Description(uint8_t * array, uint8_t size)
void PIOS_BL_HELPER_CRC_Ini()
{
}
#endif
#endif /* PIOS_INCLUDE_BL_HELPER */

View File

@ -28,7 +28,6 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
// Global variables

View File

@ -30,10 +30,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include <pios.h>
#if defined(PIOS_INCLUDE_DELAY)
#ifdef PIOS_INCLUDE_DELAY
/* these should be defined by CMSIS, but they aren't */
#define DWT_CTRL (*(volatile uint32_t *)0xe0001000)
@ -167,7 +166,7 @@ uint32_t PIOS_DELAY_DiffuS(uint32_t raw)
return diff / us_ticks;
}
#endif
#endif /* PIOS_INCLUDE_DELAY */
/**
* @}

View File

@ -28,13 +28,13 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#ifdef PIOS_INCLUDE_DSM
#include "pios_dsm_priv.h"
#if defined(PIOS_INCLUDE_DSM)
#if !defined(PIOS_INCLUDE_RTC)
#ifndef PIOS_INCLUDE_RTC
#error PIOS_INCLUDE_RTC must be used to use DSM
#endif
@ -401,7 +401,7 @@ static void PIOS_DSM_Supervisor(uint32_t dsm_id)
}
}
#endif /* PIOS_INCLUDE_DSM */
#endif /* PIOS_INCLUDE_DSM */
/**
* @}

View File

@ -29,10 +29,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_EXTI)
#ifdef PIOS_INCLUDE_EXTI
/* Map EXTI line to full config */
#define EXTI_MAX_LINES 16

View File

@ -26,7 +26,7 @@
#include "pios.h"
#if defined(PIOS_INCLUDE_FLASH_INTERNAL)
#ifdef PIOS_INCLUDE_FLASH_INTERNAL
#include "stm32f4xx_flash.h"
#include "pios_flash_internal_priv.h"
@ -334,4 +334,4 @@ const struct pios_flash_driver pios_internal_flash_driver = {
.read_data = PIOS_Flash_Internal_ReadData,
};
#endif /* defined(PIOS_INCLUDE_FLASH_INTERNAL) */
#endif /* PIOS_INCLUDE_FLASH_INTERNAL */

View File

@ -28,10 +28,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_GPIO)
#ifdef PIOS_INCLUDE_GPIO
/* Private Function Prototypes */
@ -92,7 +91,7 @@ void PIOS_GPIO_Toggle(uint8_t Pin)
GPIO_ToggleBits(GPIO_PORT[Pin], GPIO_PIN[Pin]);
}
#endif
#endif /* PIOS_INCLUDE_GPIO */
/**
* @}

View File

@ -33,12 +33,11 @@
* be merged.
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_I2C)
#ifdef PIOS_INCLUDE_I2C
#if defined(PIOS_INCLUDE_FREERTOS)
#ifdef PIOS_INCLUDE_FREERTOS
#define USE_FREERTOS
#endif
@ -1232,7 +1231,7 @@ void PIOS_I2C_ER_IRQ_Handler(uint32_t i2c_id)
}
}
#endif
#endif /* PIOS_INCLUDE_I2C */
/**
* @}

View File

@ -33,6 +33,8 @@
****************************************************************************************/
#include <pios.h>
#ifdef PIOS_INCLUDE_IAP
/****************************************************************************************
* Private Definitions/Macros
****************************************************************************************/
@ -140,3 +142,5 @@ void PIOS_IAP_WriteBootCount (uint16_t boot_count)
{
RTC_WriteBackupRegister ( IAP_BOOTCOUNT, boot_count );
}
#endif /* PIOS_INCLUDE_IAP */

View File

@ -32,10 +32,9 @@
* @todo This should be shared with the F1xx code.
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_IRQ)
#ifdef PIOS_INCLUDE_IRQ
/* Private Function Prototypes */
@ -93,7 +92,7 @@ int32_t PIOS_IRQ_Enable(void)
return 0;
}
#endif
#endif /* PIOS_INCLUDE_IRQ */
/**
* @}

View File

@ -28,10 +28,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_LED)
#ifdef PIOS_INCLUDE_LED
#include <pios_led_priv.h>
@ -166,7 +165,7 @@ void PIOS_LED_Toggle(uint32_t led_id)
}
}
#endif
#endif /* PIOS_INCLUDE_LED */
/**
* @}

View File

@ -31,6 +31,8 @@
#include <pios.h>
#ifdef PIOS_INCLUDE_OVERO
/**
* Configures the SPI device to use a double buffered DMA for transferring
* data. At the end of each transfer (NSS goes high) it makes sure to reset
@ -38,7 +40,7 @@
* buffer
*/
#if defined(PIOS_INCLUDE_SPI)
#ifdef PIOS_INCLUDE_SPI
#include <pios_overo_priv.h>
@ -368,7 +370,9 @@ static void PIOS_OVERO_RxStart(uint32_t overo_id, uint16_t rx_bytes_avail) {};
#endif /* PIOS_INCLUDE_FREERTOS */
#endif
#endif /* PIOS_INCLUDE_SPI */
#endif /* PIOS_INCLUDE_OVERO */
/**
* @}

View File

@ -28,11 +28,11 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#include "pios_ppm_priv.h"
#if defined(PIOS_INCLUDE_PPM)
#ifdef PIOS_INCLUDE_PPM
#include "pios_ppm_priv.h"
/* Provide a RCVR driver */
static int32_t PIOS_PPM_Get(uint32_t rcvr_id, uint8_t channel);
@ -349,7 +349,7 @@ static void PIOS_PPM_Supervisor(uint32_t ppm_id) {
ppm_dev->Fresh = false;
}
#endif
#endif /* PIOS_INCLUDE_PPM */
/**
* @}

View File

@ -28,11 +28,11 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#include "pios_pwm_priv.h"
#if defined(PIOS_INCLUDE_PWM)
#ifdef PIOS_INCLUDE_PWM
#include "pios_pwm_priv.h"
/* Provide a RCVR driver */
static int32_t PIOS_PWM_Get(uint32_t rcvr_id, uint8_t channel);
@ -274,7 +274,7 @@ static void PIOS_PWM_tim_edge_cb (uint32_t tim_id, uint32_t context, uint8_t cha
}
#endif
#endif /* PIOS_INCLUDE_PWM */
/**
* @}

View File

@ -28,10 +28,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_RTC)
#ifdef PIOS_INCLUDE_RTC
#include <pios_rtc_priv.h>
#ifndef PIOS_RTC_PRESCALER
@ -130,7 +130,8 @@ void PIOS_RTC_irq_handler (void)
if (EXTI_GetITStatus(EXTI_Line22) != RESET)
EXTI_ClearITPendingBit(EXTI_Line22);
}
#endif
#endif /* PIOS_INCLUDE_RTC */
/**
* @}

View File

@ -28,8 +28,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#ifdef PIOS_INCLUDE_SERVO
#include "pios_servo_priv.h"
#include "pios_tim_priv.h"
@ -153,3 +155,5 @@ void PIOS_Servo_Set(uint8_t servo, uint16_t position)
break;
}
}
#endif /* PIOS_INCLUDE_SERVO */

View File

@ -38,7 +38,7 @@
*/
#include <pios.h>
#if defined(PIOS_INCLUDE_SPI)
#ifdef PIOS_INCLUDE_SPI
#include <pios_spi_priv.h>
@ -659,7 +659,7 @@ void PIOS_SPI_IRQ_Handler(uint32_t spi_id)
}
}
#endif
#endif /* PIOS_INCLUDE_SPI */
/**
* @}

View File

@ -29,10 +29,9 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_SYS)
#ifdef PIOS_INCLUDE_SYS
/* Private Function Prototypes */
void NVIC_Configuration(void);
@ -320,7 +319,7 @@ void assert_failed(uint8_t * file, uint32_t line)
}
#endif
#endif
#endif /* PIOS_INCLUDE_SYS */
/**
* @}

View File

@ -31,7 +31,8 @@
#include "pios.h"
#include "pios_tim.h"
#ifdef PIOS_INCLUDE_TIM
#include "pios_tim_priv.h"
enum pios_tim_dev_magic {
@ -465,6 +466,8 @@ static void PIOS_TIM8_TRG_COM_TIM14_IRQHandler (void)
}
}
#endif /* PIOS_INCLUDE_TIM */
/**
* @}
* @}

View File

@ -32,10 +32,9 @@
* @todo This is virtually identical to the F1xx driver and should be merged.
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_USART)
#ifdef PIOS_INCLUDE_USART
#include <pios_usart_priv.h>
@ -350,7 +349,7 @@ static void PIOS_USART_generic_irq_handler(uint32_t usart_id)
#endif /* PIOS_INCLUDE_FREERTOS */
}
#endif
#endif /* PIOS_INCLUDE_USART */
/**
* @}

View File

@ -28,14 +28,14 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#ifdef PIOS_INCLUDE_USB
#include "usb_core.h"
#include "pios_usb_board_data.h"
#include "pios_usb.h"
#include "pios_usb_priv.h"
#if defined(PIOS_INCLUDE_USB)
/* Rx/Tx status */
static uint8_t transfer_possible = 0;
@ -261,7 +261,7 @@ void USB_OTG_BSP_TimerIRQ (void)
}
#endif /* PIOS_INCLUDE_USB */
#endif /* PIOS_INCLUDE_USB */
/**
* @}

View File

@ -29,12 +29,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_USB_CDC)
#ifdef PIOS_INCLUDE_USB_CDC
#include "pios_usb.h"
#include "pios_usb_cdc_priv.h"
#include "pios_usb_board_data.h" /* PIOS_BOARD_*_DATA_LENGTH */
@ -398,4 +396,4 @@ static void PIOS_USB_CDC_CTRL_EP_IN_Callback(void)
SetEPTxValid(usb_cdc_dev->cfg->data_tx_ep);
}
#endif /* PIOS_INCLUDE_USB_CDC */
#endif /* PIOS_INCLUDE_USB_CDC */

View File

@ -29,12 +29,10 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Project Includes */
#include "pios.h"
#if defined(PIOS_INCLUDE_USB_HID)
#ifdef PIOS_INCLUDE_USB_HID
#include "pios_usb.h"
#include "pios_usb_hid_priv.h"
#include "pios_usb_board_data.h" /* PIOS_BOARD_*_DATA_LENGTH */
#include "pios_usbhook.h" /* PIOS_USBHOOK_* */
@ -525,4 +523,4 @@ static bool PIOS_USB_HID_EP_OUT_Callback(uint32_t usb_hid_id, uint8_t epnum, uin
return rc;
}
#endif /* PIOS_INCLUDE_USB_HID */
#endif /* PIOS_INCLUDE_USB_HID */

View File

@ -37,6 +37,9 @@
*/
#include "pios.h"
#ifdef PIOS_INCLUDE_WDG
#include "stm32f4xx_iwdg.h"
#include "stm32f4xx_dbgmcu.h"
#include "stm32f4xx_rtc.h"
@ -177,3 +180,5 @@ void PIOS_WDG_Clear(void)
IWDG_ReloadCounter();
#endif
}
#endif /* PIOS_INCLUDE_WDG */