1 /******************************************************************************
2 *  Filename:       driverlib_release.h
3 *  Revised:        $Date: 2015-07-16 12:12:04 +0200 (Thu, 16 Jul 2015) $
4 *  Revision:       $Revision: 44151 $
5 *
6 *  Description:    Provides macros for ensuring that a specfic release of
7 *                  DriverLib is used.
8 *
9 *  Copyright (c) 2015, Texas Instruments Incorporated
10 *  All rights reserved.
11 *
12 *  Redistribution and use in source and binary forms, with or without
13 *  modification, are permitted provided that the following conditions are met:
14 *
15 *  1) Redistributions of source code must retain the above copyright notice,
16 *     this list of conditions and the following disclaimer.
17 *
18 *  2) Redistributions in binary form must reproduce the above copyright notice,
19 *     this list of conditions and the following disclaimer in the documentation
20 *     and/or other materials provided with the distribution.
21 *
22 *  3) Neither the name of the ORGANIZATION nor the names of its contributors may
23 *     be used to endorse or promote products derived from this software without
24 *     specific prior written permission.
25 *
26 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
30 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 *  POSSIBILITY OF SUCH DAMAGE.
37 *
38 ******************************************************************************/
39 
40 //*****************************************************************************
41 //
42 //! \addtogroup system_control_group
43 //! @{
44 //! \addtogroup driverlib_release_api
45 //! @{
46 //
47 //*****************************************************************************
48 
49 #ifndef __DRIVERLIB_RELEASE_H__
50 #define __DRIVERLIB_RELEASE_H__
51 
52 
53 #ifdef __cplusplus
54 extern "C"
55 {
56 #endif
57 
58 #include <stdint.h>
59 
60 
61 
62 
63 /// DriverLib release group number
64 #define DRIVERLIB_RELEASE_GROUP   0
65 /// DriverLib release build number
66 #define DRIVERLIB_RELEASE_BUILD   45180
67 
68 
69 
70 
71 //*****************************************************************************
72 //
73 //! This macro is called internally from within DriverLib to declare the
74 //! DriverLib release locking object:
75 //! \param group is the DriverLib release group number.
76 //! \param build is the DriverLib release build number.
77 //!
78 //! This macro shall not be called in the application unless the intention is
79 //! to bypass the release locking (at own risk).
80 //
81 //*****************************************************************************
82 #define DRIVERLIB_DECLARE_RELEASE(group, build) \
83     const volatile uint8_t driverlib_release_##group##_##build
84 
85 /// External declaration of the DriverLib release locking object
86 extern DRIVERLIB_DECLARE_RELEASE(0, 45180);
87 
88 
89 
90 
91 //*****************************************************************************
92 //
93 //! This macro shall be called once from within a function of a precompiled
94 //! software deliverable to lock the deliverable to a specific DriverLib
95 //! release. It is essential that the call is made from code that is not
96 //! optimized away.
97 //!
98 //! This macro locks to a specific DriverLib release:
99 //! \param group is the DriverLib release group number.
100 //! \param build is the DriverLib release build number.
101 //!
102 //! If attempting to use the precompiled deliverable with a different release
103 //! of DriverLib, a linker error will be produced, stating that
104 //! "driverlib_release_xx_yyyyy is undefined" or similar.
105 //!
106 //! To override the check, for example when upgrading DriverLib but not the
107 //! precompiled deliverables, or when mixing precompiled deliverables,
108 //! application developers may (at own risk) declare the missing DriverLib
109 //! release using the \ref DRIVERLIB_DECLARE_RELEASE() macro.
110 //
111 //*****************************************************************************
112 #define DRIVERLIB_ASSERT_RELEASE(group, build) \
113     (driverlib_release_##group##_##build)
114 
115 
116 
117 
118 //*****************************************************************************
119 //
120 //! This macro shall be called once from within a function of a precompiled
121 //! software deliverable to lock the deliverable to a specific DriverLib
122 //! release. It is essential that the call is made from code that is not
123 //! optimized away.
124 //!
125 //! This macro locks to the current DriverLib release used at compile-time.
126 //!
127 //! If attempting to use the precompiled deliverable with a different release
128 //! of DriverLib, a linker error will be produced, stating that
129 //! "driverlib_release_xx_yyyyy is undefined" or similar.
130 //!
131 //! To override the check, for example when upgrading DriverLib but not the
132 //! precompiled deliverables, or when mixing precompiled deliverables,
133 //! application developers may (at own risk) declare the missing DriverLib
134 //! release using the \ref DRIVERLIB_DECLARE_RELEASE() macro.
135 //
136 //*****************************************************************************
137 #define DRIVERLIB_ASSERT_CURR_RELEASE() \
138     DRIVERLIB_ASSERT_RELEASE(0, 45180)
139 
140 
141 
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif // __DRIVERLIB_RELEASE_H__
148 
149 
150 //*****************************************************************************
151 //
152 //! Close the Doxygen group.
153 //! @}
154 //! @}
155 //
156 //*****************************************************************************
157