Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

320 lines
6.9 KiB

  1. /**
  2. * \file
  3. *
  4. * \brief Decrement macro.
  5. *
  6. * Copyright (C) 2014 Atmel Corporation. All rights reserved.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  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. The name of Atmel may not be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * 4. This software may only be redistributed and used in connection with an
  26. * Atmel microcontroller product.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
  29. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  30. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  31. * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
  32. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  34. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  37. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. * POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * \asf_license_stop
  41. *
  42. */
  43. #ifndef _UTILS_DECREMENT_MACRO_H
  44. #define _UTILS_DECREMENT_MACRO_H
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48. /**
  49. * \brief Compile time decrement, result value is entire integer literal
  50. *
  51. * \param[in] val - value to be decremented
  52. */
  53. #define DEC_VALUE(val) DEC_##val
  54. // Preprocessor increment implementation
  55. #define DEC_256 255
  56. #define DEC_255 254
  57. #define DEC_254 253
  58. #define DEC_253 252
  59. #define DEC_252 251
  60. #define DEC_251 250
  61. #define DEC_250 249
  62. #define DEC_249 248
  63. #define DEC_248 247
  64. #define DEC_247 246
  65. #define DEC_246 245
  66. #define DEC_245 244
  67. #define DEC_244 243
  68. #define DEC_243 242
  69. #define DEC_242 241
  70. #define DEC_241 240
  71. #define DEC_240 239
  72. #define DEC_239 238
  73. #define DEC_238 237
  74. #define DEC_237 236
  75. #define DEC_236 235
  76. #define DEC_235 234
  77. #define DEC_234 233
  78. #define DEC_233 232
  79. #define DEC_232 231
  80. #define DEC_231 230
  81. #define DEC_230 229
  82. #define DEC_229 228
  83. #define DEC_228 227
  84. #define DEC_227 226
  85. #define DEC_226 225
  86. #define DEC_225 224
  87. #define DEC_224 223
  88. #define DEC_223 222
  89. #define DEC_222 221
  90. #define DEC_221 220
  91. #define DEC_220 219
  92. #define DEC_219 218
  93. #define DEC_218 217
  94. #define DEC_217 216
  95. #define DEC_216 215
  96. #define DEC_215 214
  97. #define DEC_214 213
  98. #define DEC_213 212
  99. #define DEC_212 211
  100. #define DEC_211 210
  101. #define DEC_210 209
  102. #define DEC_209 208
  103. #define DEC_208 207
  104. #define DEC_207 206
  105. #define DEC_206 205
  106. #define DEC_205 204
  107. #define DEC_204 203
  108. #define DEC_203 202
  109. #define DEC_202 201
  110. #define DEC_201 200
  111. #define DEC_200 199
  112. #define DEC_199 198
  113. #define DEC_198 197
  114. #define DEC_197 196
  115. #define DEC_196 195
  116. #define DEC_195 194
  117. #define DEC_194 193
  118. #define DEC_193 192
  119. #define DEC_192 191
  120. #define DEC_191 190
  121. #define DEC_190 189
  122. #define DEC_189 188
  123. #define DEC_188 187
  124. #define DEC_187 186
  125. #define DEC_186 185
  126. #define DEC_185 184
  127. #define DEC_184 183
  128. #define DEC_183 182
  129. #define DEC_182 181
  130. #define DEC_181 180
  131. #define DEC_180 179
  132. #define DEC_179 178
  133. #define DEC_178 177
  134. #define DEC_177 176
  135. #define DEC_176 175
  136. #define DEC_175 174
  137. #define DEC_174 173
  138. #define DEC_173 172
  139. #define DEC_172 171
  140. #define DEC_171 170
  141. #define DEC_170 169
  142. #define DEC_169 168
  143. #define DEC_168 167
  144. #define DEC_167 166
  145. #define DEC_166 165
  146. #define DEC_165 164
  147. #define DEC_164 163
  148. #define DEC_163 162
  149. #define DEC_162 161
  150. #define DEC_161 160
  151. #define DEC_160 159
  152. #define DEC_159 158
  153. #define DEC_158 157
  154. #define DEC_157 156
  155. #define DEC_156 155
  156. #define DEC_155 154
  157. #define DEC_154 153
  158. #define DEC_153 152
  159. #define DEC_152 151
  160. #define DEC_151 150
  161. #define DEC_150 149
  162. #define DEC_149 148
  163. #define DEC_148 147
  164. #define DEC_147 146
  165. #define DEC_146 145
  166. #define DEC_145 144
  167. #define DEC_144 143
  168. #define DEC_143 142
  169. #define DEC_142 141
  170. #define DEC_141 140
  171. #define DEC_140 139
  172. #define DEC_139 138
  173. #define DEC_138 137
  174. #define DEC_137 136
  175. #define DEC_136 135
  176. #define DEC_135 134
  177. #define DEC_134 133
  178. #define DEC_133 132
  179. #define DEC_132 131
  180. #define DEC_131 130
  181. #define DEC_130 129
  182. #define DEC_129 128
  183. #define DEC_128 127
  184. #define DEC_127 126
  185. #define DEC_126 125
  186. #define DEC_125 124
  187. #define DEC_124 123
  188. #define DEC_123 122
  189. #define DEC_122 121
  190. #define DEC_121 120
  191. #define DEC_120 119
  192. #define DEC_119 118
  193. #define DEC_118 117
  194. #define DEC_117 116
  195. #define DEC_116 115
  196. #define DEC_115 114
  197. #define DEC_114 113
  198. #define DEC_113 112
  199. #define DEC_112 111
  200. #define DEC_111 110
  201. #define DEC_110 109
  202. #define DEC_109 108
  203. #define DEC_108 107
  204. #define DEC_107 106
  205. #define DEC_106 105
  206. #define DEC_105 104
  207. #define DEC_104 103
  208. #define DEC_103 102
  209. #define DEC_102 101
  210. #define DEC_101 100
  211. #define DEC_100 99
  212. #define DEC_99 98
  213. #define DEC_98 97
  214. #define DEC_97 96
  215. #define DEC_96 95
  216. #define DEC_95 94
  217. #define DEC_94 93
  218. #define DEC_93 92
  219. #define DEC_92 91
  220. #define DEC_91 90
  221. #define DEC_90 89
  222. #define DEC_89 88
  223. #define DEC_88 87
  224. #define DEC_87 86
  225. #define DEC_86 85
  226. #define DEC_85 84
  227. #define DEC_84 83
  228. #define DEC_83 82
  229. #define DEC_82 81
  230. #define DEC_81 80
  231. #define DEC_80 79
  232. #define DEC_79 78
  233. #define DEC_78 77
  234. #define DEC_77 76
  235. #define DEC_76 75
  236. #define DEC_75 74
  237. #define DEC_74 73
  238. #define DEC_73 72
  239. #define DEC_72 71
  240. #define DEC_71 70
  241. #define DEC_70 69
  242. #define DEC_69 68
  243. #define DEC_68 67
  244. #define DEC_67 66
  245. #define DEC_66 65
  246. #define DEC_65 64
  247. #define DEC_64 63
  248. #define DEC_63 62
  249. #define DEC_62 61
  250. #define DEC_61 60
  251. #define DEC_60 59
  252. #define DEC_59 58
  253. #define DEC_58 57
  254. #define DEC_57 56
  255. #define DEC_56 55
  256. #define DEC_55 54
  257. #define DEC_54 53
  258. #define DEC_53 52
  259. #define DEC_52 51
  260. #define DEC_51 50
  261. #define DEC_50 49
  262. #define DEC_49 48
  263. #define DEC_48 47
  264. #define DEC_47 46
  265. #define DEC_46 45
  266. #define DEC_45 44
  267. #define DEC_44 43
  268. #define DEC_43 42
  269. #define DEC_42 41
  270. #define DEC_41 40
  271. #define DEC_40 39
  272. #define DEC_39 38
  273. #define DEC_38 37
  274. #define DEC_37 36
  275. #define DEC_36 35
  276. #define DEC_35 34
  277. #define DEC_34 33
  278. #define DEC_33 32
  279. #define DEC_32 31
  280. #define DEC_31 30
  281. #define DEC_30 29
  282. #define DEC_29 28
  283. #define DEC_28 27
  284. #define DEC_27 26
  285. #define DEC_26 25
  286. #define DEC_25 24
  287. #define DEC_24 23
  288. #define DEC_23 22
  289. #define DEC_22 21
  290. #define DEC_21 20
  291. #define DEC_20 19
  292. #define DEC_19 18
  293. #define DEC_18 17
  294. #define DEC_17 16
  295. #define DEC_16 15
  296. #define DEC_15 14
  297. #define DEC_14 13
  298. #define DEC_13 12
  299. #define DEC_12 11
  300. #define DEC_11 10
  301. #define DEC_10 9
  302. #define DEC_9 8
  303. #define DEC_8 7
  304. #define DEC_7 6
  305. #define DEC_6 5
  306. #define DEC_5 4
  307. #define DEC_4 3
  308. #define DEC_3 2
  309. #define DEC_2 1
  310. #define DEC_1 0
  311. #ifdef __cplusplus
  312. }
  313. #endif
  314. #endif /* _UTILS_DECREMENT_MACRO_H */