Skip to content

Commit

Permalink
[chibios] more common confs
Browse files Browse the repository at this point in the history
- use a common halconf.h
- common chconf.h instead of per board
- USE_x flags in mcuconf
  • Loading branch information
flixr committed Feb 17, 2015
1 parent 3ffba98 commit 6e439ad
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 862 deletions.
File renamed without changes.
Expand Up @@ -34,6 +34,7 @@
#ifndef _HALCONF_H_
#define _HALCONF_H_

/* include board specific conf */
#include "mcuconf.h"

/**
Expand All @@ -59,7 +60,11 @@
* @brief Enables the ADC subsystem.
*/
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
#if USE_ADC
#define HAL_USE_ADC TRUE
#else
#define HAL_USE_ADC FALSE
#endif
#endif

/**
Expand Down Expand Up @@ -87,7 +92,11 @@
* @brief Enables the I2C subsystem.
*/
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
#if USE_I2C1 || USE_I2C2 || USE_I2C3
#define HAL_USE_I2C TRUE
#else
#define HAL_USE_I2C FALSE
#endif
#endif

/**
Expand Down Expand Up @@ -136,21 +145,33 @@
* @brief Enables the SERIAL subsystem.
*/
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
#if USE_UART1 || USE_UART2 || USE_UART3 || USE_UART4 || USE_UART5 || USE_UART6
#define HAL_USE_SERIAL TRUE
#else
#define HAL_USE_SERIAL FALSE
#endif
#endif

/**
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#if USE_USB_SERIAL
#define HAL_USE_SERIAL_USB TRUE
#else
#define HAL_USE_SERIAL_USB FALSE
#endif
#endif

/**
* @brief Enables the SPI subsystem.
*/
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
#if USE_SPI
#define HAL_USE_SPI TRUE
#else
#define HAL_USE_SPI FALSE
#endif
#endif

/**
Expand Down

0 comments on commit 6e439ad

Please sign in to comment.