Oops - fix broken SPI driver due to missing bit inversion on a port mask.
[pub/lufa.git] / LUFA / Drivers / Board / Temperature.h
index c44c60d..ba9752e 100644 (file)
@@ -1,7 +1,7 @@
 /*
              LUFA Library
      Copyright (C) Dean Camera, 2010.
 /*
              LUFA Library
      Copyright (C) Dean Camera, 2010.
-              
+
   dean [at] fourwalledcubicle [dot] com
       www.fourwalledcubicle.com
 */
   dean [at] fourwalledcubicle [dot] com
       www.fourwalledcubicle.com
 */
@@ -9,13 +9,13 @@
 /*
   Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
 /*
   Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
-  Permission to use, copy, modify, distribute, and sell this 
+  Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
   software and its documentation for any purpose is hereby granted
-  without fee, provided that the above copyright notice appear in 
+  without fee, provided that the above copyright notice appear in
   all copies and that both that the copyright notice and this
   all copies and that both that the copyright notice and this
-  permission notice and warranty disclaimer appear in supporting 
-  documentation, and that the name of the author not be used in 
-  advertising or publicity pertaining to distribution of the 
+  permission notice and warranty disclaimer appear in supporting
+  documentation, and that the name of the author not be used in
+  advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
   The author disclaim all warranties with regard to this
   software without specific, written prior permission.
 
   The author disclaim all warranties with regard to this
@@ -58,7 +58,7 @@
 
                #include "../../Common/Common.h"
                #include "../Peripheral/ADC.h"
 
                #include "../../Common/Common.h"
                #include "../Peripheral/ADC.h"
-       
+
                #if (BOARD == BOARD_NONE)
                        #error The Board Temperature Sensor driver cannot be used if the makefile BOARD option is not set.
                #elif ((BOARD != BOARD_USBKEY) && (BOARD != BOARD_STK525) && \
                #if (BOARD == BOARD_NONE)
                        #error The Board Temperature Sensor driver cannot be used if the makefile BOARD option is not set.
                #elif ((BOARD != BOARD_USBKEY) && (BOARD != BOARD_STK525) && \
@@ -76,7 +76,7 @@
                /* Macros: */
                        /** ADC channel number for the temperature sensor. */
                        #define TEMP_ADC_CHANNEL       0
                /* Macros: */
                        /** ADC channel number for the temperature sensor. */
                        #define TEMP_ADC_CHANNEL       0
-                       
+
                        /** ADC channel MUX mask for the temperature sensor. */
                        #define TEMP_ADC_CHANNEL_MASK  ADC_CHANNEL0
 
                        /** ADC channel MUX mask for the temperature sensor. */
                        #define TEMP_ADC_CHANNEL_MASK  ADC_CHANNEL0
 
 
                        /** Maximum returnable temperature from the \ref Temperature_GetTemperature() function. */
                        #define TEMP_MAX_TEMP          ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)
 
                        /** Maximum returnable temperature from the \ref Temperature_GetTemperature() function. */
                        #define TEMP_MAX_TEMP          ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)
-               
-               /* Pseudo-Function Macros: */
-                       #if defined(__DOXYGEN__)
-                               /** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.
-                                *  This must be called before any other temperature sensor routines.
-                                *
-                                *  \pre The ADC itself (not the ADC channel) must be configured separately before calling the
-                                *       temperature sensor functions.
-                                */
-                               static inline void Temperature_Init(void);
-                       #else
-                               #define Temperature_Init() ADC_SetupChannel(TEMP_ADC_CHANNEL);
-                       #endif
+
+               /* Inline Functions: */
+                       /** Initialises the temperature sensor driver, including setting up the appropriate ADC channel.
+                        *  This must be called before any other temperature sensor routines.
+                        *
+                        *  \pre The ADC itself (not the ADC channel) must be configured separately before calling the
+                        *       temperature sensor functions.
+                        */
+                       static inline void Temperature_Init(void) ATTR_ALWAYS_INLINE;
+                       static inline void Temperature_Init(void)
+                       {
+                               ADC_SetupChannel(TEMP_ADC_CHANNEL);
+                       }
 
                /* Function Prototypes: */
                        /** Performs a complete ADC on the temperature sensor channel, and converts the result into a
 
                /* Function Prototypes: */
                        /** Performs a complete ADC on the temperature sensor channel, and converts the result into a
                #if defined(__cplusplus)
                        }
                #endif
                #if defined(__cplusplus)
                        }
                #endif
-               
+
 #endif
 
 /** @} */
 #endif
 
 /** @} */
+