Apply #ifdef/#ifndef where possible

This commit is contained in:
Scott Lahteine
2019-09-01 23:54:41 -05:00
parent 4078f2672e
commit 34b73426e5
32 changed files with 141 additions and 141 deletions

View File

@ -230,7 +230,7 @@
/* Define NO_INIT attribute */
#if 0 //ndef NO_INIT
#if defined ( __CC_ARM )
#ifdef __CC_ARM
# define NO_INIT __attribute__((zero_init))
#elif defined ( __ICCARM__ )
# define NO_INIT __no_init
@ -262,7 +262,7 @@
//! @{
typedef unsigned char Bool; //!< Boolean.
#ifndef __cplusplus
#if !defined(__bool_true_false_are_defined)
#ifndef __bool_true_false_are_defined
typedef unsigned char bool; //!< Boolean.
#endif
#endif
@ -443,7 +443,7 @@ typedef struct
#define DISABLE 0
#define ENABLE 1
#ifndef __cplusplus
#if !defined(__bool_true_false_are_defined)
#ifndef __bool_true_false_are_defined
#define false 0
#define true 1
#endif

View File

@ -61,27 +61,27 @@ extern "C" {
* Below BOARD_XXX macros are related to the specific board, and
* should be defined by the board code, otherwise default value are used.
*/
#if !defined(BOARD_FREQ_SLCK_XTAL)
#ifndef BOARD_FREQ_SLCK_XTAL
# warning The board slow clock xtal frequency has not been defined.
# define BOARD_FREQ_SLCK_XTAL (32768UL)
#endif
#if !defined(BOARD_FREQ_SLCK_BYPASS)
#ifndef BOARD_FREQ_SLCK_BYPASS
# warning The board slow clock bypass frequency has not been defined.
# define BOARD_FREQ_SLCK_BYPASS (32768UL)
#endif
#if !defined(BOARD_FREQ_MAINCK_XTAL)
#ifndef BOARD_FREQ_MAINCK_XTAL
# warning The board main clock xtal frequency has not been defined.
# define BOARD_FREQ_MAINCK_XTAL (12000000UL)
#endif
#if !defined(BOARD_FREQ_MAINCK_BYPASS)
#ifndef BOARD_FREQ_MAINCK_BYPASS
# warning The board main clock bypass frequency has not been defined.
# define BOARD_FREQ_MAINCK_BYPASS (12000000UL)
#endif
#if !defined(BOARD_OSC_STARTUP_US)
#ifndef BOARD_OSC_STARTUP_US
# warning The board main clock xtal startup time has not been defined.
# define BOARD_OSC_STARTUP_US (15625UL)
#endif

View File

@ -43,12 +43,12 @@
* \asf_license_stop
*
*/
/*
* Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
*/
#ifndef _SPC_PROTOCOL_H_
#define _SPC_PROTOCOL_H_
#ifndef _SPC_PROTOCOL_H_
#define _SPC_PROTOCOL_H_
/**
* \ingroup usb_msc_protocol

View File

@ -55,7 +55,7 @@
#include "udi.h"
// Check the number of port
#ifndef UDI_CDC_PORT_NB
#ifndef UDI_CDC_PORT_NB
# define UDI_CDC_PORT_NB 1
#endif
#if (UDI_CDC_PORT_NB < 1) || (UDI_CDC_PORT_NB > 7)

View File

@ -50,7 +50,7 @@
#include "usb_protocol_cdc.h"
#include "conf_usb.h"
#ifndef UDI_CDC_PORT_NB
#ifndef UDI_CDC_PORT_NB
# define UDI_CDC_PORT_NB 1
#endif

View File

@ -58,7 +58,7 @@
#define SPI_2XCLOCK_MASK 0x01 // SPI2X = bit 0 on SPSR
// define SPI_AVR_EIMSK for AVR boards with external interrupt pins
#if defined(EIMSK)
#ifdef EIMSK
#define SPI_AVR_EIMSK EIMSK
#elif defined(GICR)
#define SPI_AVR_EIMSK GICR