aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Common
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-04-15 11:04:24 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-04-15 11:04:24 +0000
commit3eb81df998349e90c3d973e6301f19382c5b2e84 (patch)
tree400cfc27dfebf45ebcb0e66b453aaafab908d442 /LUFA/Common
parent5e14c194c9a2f5cb52a43f7efeacb795a38ced74 (diff)
downloadlufa-3eb81df998349e90c3d973e6301f19382c5b2e84.tar.gz
lufa-3eb81df998349e90c3d973e6301f19382c5b2e84.tar.bz2
lufa-3eb81df998349e90c3d973e6301f19382c5b2e84.zip
Rename FunctionAttributes.h to Attributes.h, as some attributes are applicable to variables also. Add new ATTR_NOINIT attribute for global variables.
Add the beginnings of a SDP implentation to the incomplete BluetoothHost demo. Add const attribute to the Mass Storage Host driver functions where it was applicable, but missing.
Diffstat (limited to 'LUFA/Common')
-rw-r--r--LUFA/Common/Attributes.h (renamed from LUFA/Common/FunctionAttributes.h)21
-rw-r--r--LUFA/Common/Common.h4
2 files changed, 17 insertions, 8 deletions
diff --git a/LUFA/Common/FunctionAttributes.h b/LUFA/Common/Attributes.h
index a3c9a8a3a..62d40734a 100644
--- a/LUFA/Common/FunctionAttributes.h
+++ b/LUFA/Common/Attributes.h
@@ -29,11 +29,12 @@
*/
/** \file
- * \brief AVR-GCC special function attribute macros.
+ * \brief AVR-GCC special function/variable attribute macros.
*
- * This file contains macros for applying GCC specific attributes to functions to control various optimizer
- * and code generation features of the compiler. Attributes may be placed in the function prototype in any
- * order, and multiple attributes can be specified for a single function via a space separated list.
+ * This file contains macros for applying GCC specific attributes to functions and variables to control various
+ * optimizer and code generation features of the compiler. Attributes may be placed in the function prototype
+ * or variable declaration in any order, and multiple attributes can be specified for a single item via a space
+ * separated list.
*
* On incompatible versions of GCC or on other compilers, these macros evaluate to nothing unless they are
* critical to the code's function and thus must throw a compiler error when used.
@@ -43,9 +44,10 @@
*/
/** \ingroup Group_Common
- * @defgroup Group_FuncAttr Function Attributes
+ * @defgroup Group_GCCAttr Function/Variable Attributes
*
- * Macros for easy access GCC function attributes, which can be applied to function prototypes.
+ * Macros for easy access GCC function and variable attributes, which can be applied to function prototypes or
+ * variable attributes.
*
* @{
*/
@@ -110,6 +112,13 @@
* identical name (in which case the weak reference is discarded at link time).
*/
#define ATTR_WEAK __attribute__ ((weak))
+
+ /** Forces the compiler to not automatically zero the given global variable on startup, so that the
+ * current RAM contents is retained. Under most conditions this value will be random due to the
+ * behaviour of volatile memory once power is removed, but may be used in some specific circumstances,
+ * like the passing of values back after a system watchdog reset.
+ */
+ #define ATTR_NO_INIT __attribute__ ((section (".noinit")))
#endif
/** Places the function in one of the initialization sections, which execute before the main function
diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h
index f64de8ff8..5f1b2eae5 100644
--- a/LUFA/Common/Common.h
+++ b/LUFA/Common/Common.h
@@ -32,7 +32,7 @@
* \brief Common library convenience macros and functions.
*
* This file contains macros which are common to all library elements, and which may be useful in user code. It
- * also includes other common headers, such as Atomic.h, FunctionAttributes.h and BoardTypes.h.
+ * also includes other common headers, such as Atomic.h, Attributes.h and BoardTypes.h.
*/
/** @defgroup Group_Common Common Utility Headers - LUFA/Drivers/Common/Common.h
@@ -59,7 +59,7 @@
/* Includes: */
#include <avr/io.h>
- #include "FunctionAttributes.h"
+ #include "Attributes.h"
#include "BoardTypes.h"
/* Public Interface - May be used in end-application: */