Jim Carver / Mbed OS mbed-cloud-workshop-connect-PIR

Dependencies:   HTS221

Fork of mbed-cloud-workshop-connect-HTS221 by Jim Carver

Committer:
JimCarver
Date:
Thu Oct 25 14:00:12 2018 +0000
Revision:
4:e518dde96e59
Parent:
0:6b753f761943
Simulated dispenser

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JimCarver 0:6b753f761943 1 /*******************************************************************************
JimCarver 0:6b753f761943 2 * Copyright 2016, 2017 ARM Ltd.
JimCarver 0:6b753f761943 3 *
JimCarver 0:6b753f761943 4 * Licensed under the Apache License, Version 2.0 (the "License");
JimCarver 0:6b753f761943 5 * you may not use this file except in compliance with the License.
JimCarver 0:6b753f761943 6 * You may obtain a copy of the License at
JimCarver 0:6b753f761943 7 *
JimCarver 0:6b753f761943 8 * http://www.apache.org/licenses/LICENSE-2.0
JimCarver 0:6b753f761943 9 *
JimCarver 0:6b753f761943 10 * Unless required by applicable law or agreed to in writing, software
JimCarver 0:6b753f761943 11 * distributed under the License is distributed on an "AS IS" BASIS,
JimCarver 0:6b753f761943 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
JimCarver 0:6b753f761943 13 * See the License for the specific language governing permissions and
JimCarver 0:6b753f761943 14 * limitations under the License.
JimCarver 0:6b753f761943 15 *******************************************************************************/
JimCarver 0:6b753f761943 16
JimCarver 0:6b753f761943 17
JimCarver 0:6b753f761943 18 #ifndef _PAL_MACROS_H
JimCarver 0:6b753f761943 19 #define _PAL_MACROS_H
JimCarver 0:6b753f761943 20
JimCarver 0:6b753f761943 21 #ifdef __cplusplus
JimCarver 0:6b753f761943 22 extern "C" {
JimCarver 0:6b753f761943 23 #endif
JimCarver 0:6b753f761943 24
JimCarver 0:6b753f761943 25 //for PAL_LOG prints
JimCarver 0:6b753f761943 26 #include "pal.h"
JimCarver 0:6b753f761943 27 #include "mbed-trace/mbed_trace.h"
JimCarver 0:6b753f761943 28 #include "assert.h"
JimCarver 0:6b753f761943 29 #include <limits.h>
JimCarver 0:6b753f761943 30 /*! \file pal_macros.h
JimCarver 0:6b753f761943 31 * \brief PAL macros.
JimCarver 0:6b753f761943 32 * This file contains macros defined by PAL for constant values and network purposes.
JimCarver 0:6b753f761943 33 */
JimCarver 0:6b753f761943 34
JimCarver 0:6b753f761943 35 // Maximum integer types.
JimCarver 0:6b753f761943 36 #define PAL_MAX_UINT8 0xFFU
JimCarver 0:6b753f761943 37 #define PAL_MAX_UINT16 0xFFFFU
JimCarver 0:6b753f761943 38 #define PAL_MAX_UINT32 0xFFFFFFFFUL
JimCarver 0:6b753f761943 39 #define PAL_MAX_INT32 0x7FFFFFFFL
JimCarver 0:6b753f761943 40 #define PAL_MIN_INT32 0x80000000L
JimCarver 0:6b753f761943 41 #define PAL_MAX_UINT64 0xFFFFFFFFFFFFFFFFULL
JimCarver 0:6b753f761943 42 #define PAL_MAX_INT64 0x7FFFFFFFFFFFFFFFLL
JimCarver 0:6b753f761943 43
JimCarver 0:6b753f761943 44 // Useful macros.
JimCarver 0:6b753f761943 45
JimCarver 0:6b753f761943 46
JimCarver 0:6b753f761943 47
JimCarver 0:6b753f761943 48 #if defined(__arm__) || defined(__IAR_SYSTEMS_ICC__) // Compile with ARMCC, GCC_ARM or IAR compilers.
JimCarver 0:6b753f761943 49 #define PAL_TARGET_POINTER_SIZE __sizeof_ptr
JimCarver 0:6b753f761943 50 #ifdef __BIG_ENDIAN
JimCarver 0:6b753f761943 51 #define PAL_COMPILATION_ENDIANITY 1 // Define PAL compilation endian (0 is little endian, 1 is big endian).
JimCarver 0:6b753f761943 52 #else
JimCarver 0:6b753f761943 53 #define PAL_COMPILATION_ENDIANITY 0 // Define PAL compilation endian (0 is little endian, 1 is big endian).
JimCarver 0:6b753f761943 54 #endif
JimCarver 0:6b753f761943 55 #elif defined(__GNUC__) // Compiling with GCC.
JimCarver 0:6b753f761943 56 #define PAL_TARGET_POINTER_SIZE __SIZEOF_POINTER__
JimCarver 0:6b753f761943 57 #ifdef __BYTE_ORDER
JimCarver 0:6b753f761943 58 #if __BYTE_ORDER == __BIG_ENDIAN // If both are not defined it is TRUE!
JimCarver 0:6b753f761943 59 #define PAL_COMPILATION_ENDIANITY 1 // Define PAL compilation endian (0 is little endian, 1 is big endian).
JimCarver 0:6b753f761943 60 #elif __BYTE_ORDER == __LITTLE_ENDIAN
JimCarver 0:6b753f761943 61 #define PAL_COMPILATION_ENDIANITY 0// Define PAL compilation endian (0 is little endian, 1 is big endian).
JimCarver 0:6b753f761943 62 #else
JimCarver 0:6b753f761943 63 #error missing endiantiy defintion for GCC
JimCarver 0:6b753f761943 64 #endif
JimCarver 0:6b753f761943 65 #endif
JimCarver 0:6b753f761943 66 #else
JimCarver 0:6b753f761943 67 #error neither ARM target compilers nor GCC used for compilation - not supported
JimCarver 0:6b753f761943 68 #endif
JimCarver 0:6b753f761943 69
JimCarver 0:6b753f761943 70
JimCarver 0:6b753f761943 71
JimCarver 0:6b753f761943 72
JimCarver 0:6b753f761943 73 #define PAL_MAX(a,b) ((a) > (b) ? (a) : (b))
JimCarver 0:6b753f761943 74
JimCarver 0:6b753f761943 75 #define PAL_MIN(a,b) ((a) < (b) ? (a) : (b))
JimCarver 0:6b753f761943 76
JimCarver 0:6b753f761943 77 #define PAL_DIVIDE_ROUND_UP(num, divider) (((num) + (divider) - 1) / (divider))
JimCarver 0:6b753f761943 78
JimCarver 0:6b753f761943 79 #if PAL_COMPILATION_ENDIANITY == 1
JimCarver 0:6b753f761943 80 #define BIG__ENDIAN 1
JimCarver 0:6b753f761943 81 #elif PAL_COMPILATION_ENDIANITY == 0
JimCarver 0:6b753f761943 82 #define LITTLE__ENDIAN 1
JimCarver 0:6b753f761943 83 #else
JimCarver 0:6b753f761943 84 #error neither BIG__ENDIAN nor LITTLE__ENDIAN defined, cannot compile
JimCarver 0:6b753f761943 85 #endif
JimCarver 0:6b753f761943 86
JimCarver 0:6b753f761943 87
JimCarver 0:6b753f761943 88 // Endianity macros.
JimCarver 0:6b753f761943 89 #ifdef LITTLE__ENDIAN
JimCarver 0:6b753f761943 90
JimCarver 0:6b753f761943 91 #define PAL_HTONS(x) (((((unsigned short)(x)) >> 8) & 0xff) | \
JimCarver 0:6b753f761943 92 ((((unsigned short)(x)) & 0xff) << 8))
JimCarver 0:6b753f761943 93 #define PAL_NTOHS(x) (((((unsigned short)(x)) >> 8) & 0xff) | \
JimCarver 0:6b753f761943 94 ((((unsigned short)(x)) & 0xff) << 8) )
JimCarver 0:6b753f761943 95 #define PAL_HTONL(x) ((((x)>>24) & 0xffL) | (((x)>>8) & 0xff00L) | \
JimCarver 0:6b753f761943 96 (((x)<<8) & 0xff0000L) | (((x)<<24) & 0xff000000L))
JimCarver 0:6b753f761943 97 #define PAL_NTOHL(x) ((((x)>>24) & 0xffL) | (((x)>>8) & 0xff00L) | \
JimCarver 0:6b753f761943 98 (((x)<<8) & 0xff0000L) | (((x)<<24) & 0xff000000L))
JimCarver 0:6b753f761943 99
JimCarver 0:6b753f761943 100 #elif defined(BIG__ENDIAN)
JimCarver 0:6b753f761943 101
JimCarver 0:6b753f761943 102 #define PAL_HTONS(x) (x)
JimCarver 0:6b753f761943 103 #define PAL_NTOHS(x) (x)
JimCarver 0:6b753f761943 104 #define PAL_HTONL(x) (x)
JimCarver 0:6b753f761943 105 #define PAL_NTOHL(x) (x)
JimCarver 0:6b753f761943 106 #else
JimCarver 0:6b753f761943 107 #error neither BIG__ENDIAN nor LITTLE__ENDIAN defined, cannot compile
JimCarver 0:6b753f761943 108 #endif
JimCarver 0:6b753f761943 109
JimCarver 0:6b753f761943 110
JimCarver 0:6b753f761943 111 #define PAL_GET_LOWER_8BITS(x) (x & 0xFF)
JimCarver 0:6b753f761943 112
JimCarver 0:6b753f761943 113 #define PAL_INVERSE_UINT16_BYTES( val ) \
JimCarver 0:6b753f761943 114 ( ((val) << 8) | (((val) & 0x0000FF00) >> 8))
JimCarver 0:6b753f761943 115
JimCarver 0:6b753f761943 116 #define PAL_INVERSE_UINT32_BYTES( val ) \
JimCarver 0:6b753f761943 117 ( ((val) >> 24) | (((val) & 0x00FF0000) >> 8) | (((val) & 0x0000FF00) << 8) | (((val) & 0x000000FF) << 24) )
JimCarver 0:6b753f761943 118
JimCarver 0:6b753f761943 119 #define PAL_INVERSE_UINT64_BYTES( val ) \
JimCarver 0:6b753f761943 120 ((PAL_INVERSE_UINT32_BYTES( ((val >> 16) >> 16)) &0xffffffff) | ((((uint64_t)PAL_INVERSE_UINT32_BYTES(val & 0xffffffff))<<16)<<16))
JimCarver 0:6b753f761943 121
JimCarver 0:6b753f761943 122 /* Set of Macros similar to the HTONS/L, NTOHS/L ones but converting to/from little endian instead of big endian. */
JimCarver 0:6b753f761943 123 #ifdef LITTLE__ENDIAN
JimCarver 0:6b753f761943 124 #define PAL_LITTLE_ENDIAN_TO_HOST_16BIT(x) (x)
JimCarver 0:6b753f761943 125 #define PAL_LITTLE_ENDIAN_TO_HOST_32BIT(x) (x)
JimCarver 0:6b753f761943 126 #define PAL_LITTLE_ENDIAN_TO_HOST_64BIT(x) (x)
JimCarver 0:6b753f761943 127 #define PAL_HOST_TO_LITTLE_ENDIAN_16BIT(x) (x)
JimCarver 0:6b753f761943 128 #define PAL_HOST_TO_LITTLE_ENDIAN_32BIT(x) (x)
JimCarver 0:6b753f761943 129 #define PAL_HOST_TO_LITTLE_ENDIAN_64BIT(x) (x)
JimCarver 0:6b753f761943 130
JimCarver 0:6b753f761943 131
JimCarver 0:6b753f761943 132
JimCarver 0:6b753f761943 133
JimCarver 0:6b753f761943 134 #elif defined(BIG__ENDIAN)
JimCarver 0:6b753f761943 135 #define PAL_LITTLE_ENDIAN_TO_HOST_16BIT(x) (PAL_INVERSE_UINT16_BYTES(((uint16_t)x)))
JimCarver 0:6b753f761943 136 #define PAL_LITTLE_ENDIAN_TO_HOST_32BIT(x) (PAL_INVERSE_UINT32_BYTES(((uint32_t)x)))
JimCarver 0:6b753f761943 137 #define PAL_LITTLE_ENDIAN_TO_HOST_64BIT(x) (PAL_INVERSE_UINT64_BYTES(((uint64_t)x)))
JimCarver 0:6b753f761943 138 #define PAL_HOST_TO_LITTLE_ENDIAN_16BIT(x) (PAL_INVERSE_UINT16_BYTES(((uint16_t)x)))
JimCarver 0:6b753f761943 139 #define PAL_HOST_TO_LITTLE_ENDIAN_32BIT(x) (PAL_INVERSE_UINT32_BYTES(((uint32_t)x)))
JimCarver 0:6b753f761943 140 #define PAL_HOST_TO_LITTLE_ENDIAN_64BIT(x) (PAL_INVERSE_UINT64_BYTES(((uint64_t)x)))
JimCarver 0:6b753f761943 141
JimCarver 0:6b753f761943 142 #else
JimCarver 0:6b753f761943 143 #error neither BIG__ENDIAN nor LITTLE__ENDIAN defined, cannot compile
JimCarver 0:6b753f761943 144 #endif
JimCarver 0:6b753f761943 145
JimCarver 0:6b753f761943 146
JimCarver 0:6b753f761943 147 #define PAL_MODULE_INIT(INIT) INIT= 1
JimCarver 0:6b753f761943 148 #define PAL_MODULE_DEINIT(INIT) INIT= 0
JimCarver 0:6b753f761943 149
JimCarver 0:6b753f761943 150 //!< Time utility values
JimCarver 0:6b753f761943 151 #define PAL_MILISEC_TO_SEC(milisec) (milisec/1000)
JimCarver 0:6b753f761943 152 #define PAL_ONE_SEC 1
JimCarver 0:6b753f761943 153 #define PAL_SECONDS_PER_MIN 60
JimCarver 0:6b753f761943 154 #define PAL_MINUTES_PER_HOUR 60
JimCarver 0:6b753f761943 155 #define PAL_HOURS_PER_DAY 24
JimCarver 0:6b753f761943 156 #define PAL_SECONDS_PER_HOUR PAL_MINUTES_PER_HOUR * PAL_SECONDS_PER_MIN
JimCarver 0:6b753f761943 157 #define PAL_SECONDS_PER_DAY PAL_HOURS_PER_DAY * PAL_SECONDS_PER_HOUR
JimCarver 0:6b753f761943 158 #define PAL_DAYS_IN_A_YEAR (365U)
JimCarver 0:6b753f761943 159 #define PAL_RATIO_SECONDS_PER_DAY 480
JimCarver 0:6b753f761943 160 #define PAL_MINIMUM_RTC_LATENCY_SEC 100
JimCarver 0:6b753f761943 161 #define PAL_MINIMUM_STORAGE_LATENCY_SEC 500000
JimCarver 0:6b753f761943 162 #define PAL_MINIMUM_SOTP_FORWARD_LATENCY_SEC 100000
JimCarver 0:6b753f761943 163 #define PAL_MINIMUM_SOTP_BACKWARD_LATENCY_SEC 100
JimCarver 0:6b753f761943 164 #define PAL_FEB_MONTH 2
JimCarver 0:6b753f761943 165 #define PAL_MILLI_PER_SECOND 1000
JimCarver 0:6b753f761943 166 #define PAL_NANO_PER_MILLI 1000000L
JimCarver 0:6b753f761943 167 #define PAL_NANO_PER_SECOND 1000000000L
JimCarver 0:6b753f761943 168 #define PAL_MILLI_TO_NANO(x) (((x) % PAL_MILLI_PER_SECOND) * PAL_NANO_PER_MILLI)
JimCarver 0:6b753f761943 169 #define PAL_MILISEC_TO_SEC(milisec) (milisec/1000)
JimCarver 0:6b753f761943 170 #define PAL_MIN_SEC_FROM_EPOCH 1487015542 ////at least 47 years passed from 1.1.1970 in seconds
JimCarver 0:6b753f761943 171 #define PAL_MIN_RTC_SET_TIME PAL_MIN_SEC_FROM_EPOCH
JimCarver 0:6b753f761943 172 #define PAL_LAST_SAVED_TIME_LATENCY_SEC 2500000
JimCarver 0:6b753f761943 173
JimCarver 0:6b753f761943 174 //!< Define static function and inline function.
JimCarver 0:6b753f761943 175 #if defined (__CC_ARM) /* ARM compiler. */
JimCarver 0:6b753f761943 176 #define PAL_INLINE __inline
JimCarver 0:6b753f761943 177 #elif defined (__GNUC__) /* GNU compiler. */
JimCarver 0:6b753f761943 178 #define PAL_INLINE __attribute__((always_inline)) __inline
JimCarver 0:6b753f761943 179 #else
JimCarver 0:6b753f761943 180 #define PAL_INLINE //!< User should provide the compiler inline function command.
JimCarver 0:6b753f761943 181 #endif
JimCarver 0:6b753f761943 182
JimCarver 0:6b753f761943 183 #define PAL_PRIVATE static
JimCarver 0:6b753f761943 184
JimCarver 0:6b753f761943 185 #if defined (__CC_ARM) /* ARM compiler. */
JimCarver 0:6b753f761943 186 #define PAL_PRAGMA(x)
JimCarver 0:6b753f761943 187 #define PAL_DEPRECATED(x)
JimCarver 0:6b753f761943 188 #else
JimCarver 0:6b753f761943 189 #define PAL_PRAGMA(x) _Pragma (#x)
JimCarver 0:6b753f761943 190 #define PAL_DEPRECATED(x) PAL_PRAGMA(message ("!!! PAL DEPRECATED CODE- " #x))
JimCarver 0:6b753f761943 191 #endif
JimCarver 0:6b753f761943 192
JimCarver 0:6b753f761943 193 #ifdef DEBUG
JimCarver 0:6b753f761943 194
JimCarver 0:6b753f761943 195 #define PAL_MODULE_IS_INIT(INIT) if(!INIT) return PAL_ERR_NOT_INITIALIZED;
JimCarver 0:6b753f761943 196
JimCarver 0:6b753f761943 197
JimCarver 0:6b753f761943 198 #else
JimCarver 0:6b753f761943 199 #define PAL_MODULE_IS_INIT(INIT) (void)INIT
JimCarver 0:6b753f761943 200
JimCarver 0:6b753f761943 201 #endif //DEBUG
JimCarver 0:6b753f761943 202
JimCarver 0:6b753f761943 203 // Compile time assert.
JimCarver 0:6b753f761943 204 #define PAL_ASSERT_STATIC(e) \
JimCarver 0:6b753f761943 205 do { \
JimCarver 0:6b753f761943 206 enum { assert_static__ = 1/(e) }; \
JimCarver 0:6b753f761943 207 } while (0)
JimCarver 0:6b753f761943 208
JimCarver 0:6b753f761943 209 #define PAL_UNUSED_ARG(x) (void)(x)
JimCarver 0:6b753f761943 210
JimCarver 0:6b753f761943 211
JimCarver 0:6b753f761943 212
JimCarver 0:6b753f761943 213
JimCarver 0:6b753f761943 214
JimCarver 0:6b753f761943 215 //for non recoverable errors
JimCarver 0:6b753f761943 216 #define PAL_LOG_ASSERT( ARGS...) \
JimCarver 0:6b753f761943 217 { \
JimCarver 0:6b753f761943 218 tr_err(ARGS); \
JimCarver 0:6b753f761943 219 assert(0);\
JimCarver 0:6b753f761943 220 }
JimCarver 0:6b753f761943 221
JimCarver 0:6b753f761943 222
JimCarver 0:6b753f761943 223
JimCarver 0:6b753f761943 224 #define PAL_LOG_ERR_FUNC tr_err
JimCarver 0:6b753f761943 225 #define PAL_LOG_WARN_FUNC tr_warn
JimCarver 0:6b753f761943 226 #define PAL_LOG_INFO_FUNC tr_info
JimCarver 0:6b753f761943 227 #define PAL_LOG_DBG_FUNC tr_debug
JimCarver 0:6b753f761943 228
JimCarver 0:6b753f761943 229 // Little trick with mbed-trace error level is equal to function name handling the same level of log output
JimCarver 0:6b753f761943 230 #define PAL_LOG_LEVEL_ERR TRACE_LEVEL_ERROR
JimCarver 0:6b753f761943 231 #define PAL_LOG_LEVEL_WARN TRACE_LEVEL_WARN
JimCarver 0:6b753f761943 232 #define PAL_LOG_LEVEL_INFO TRACE_LEVEL_INFO
JimCarver 0:6b753f761943 233 #define PAL_LOG_LEVEL_DBG TRACE_LEVEL_DEBUG
JimCarver 0:6b753f761943 234
JimCarver 0:6b753f761943 235 #define PAL_LOG_ERR( ARGS...) PAL_LOG_ERR_FUNC(ARGS);
JimCarver 0:6b753f761943 236 #define PAL_LOG_WARN( ARGS...) PAL_LOG_WARN_FUNC(ARGS);
JimCarver 0:6b753f761943 237 #define PAL_LOG_INFO( ARGS...) PAL_LOG_INFO_FUNC(ARGS);
JimCarver 0:6b753f761943 238 #define PAL_LOG_DBG( ARGS...) PAL_LOG_DBG_FUNC(ARGS);
JimCarver 0:6b753f761943 239
JimCarver 0:6b753f761943 240
JimCarver 0:6b753f761943 241 #define PAL_LOG(LOG_LEVEL, ARGS...) tracef(PAL_LOG_LEVEL_##LOG_LEVEL, "PAL" , ARGS);
JimCarver 0:6b753f761943 242
JimCarver 0:6b753f761943 243
JimCarver 0:6b753f761943 244 #ifdef DEBUG
JimCarver 0:6b753f761943 245 #ifdef VERBOSE
JimCarver 0:6b753f761943 246 #define PAL_PRINTF( ARGS...) \
JimCarver 0:6b753f761943 247 #define PAL_PRINTF(fmt, ...) PAL_LOG(DBG, "%s:%d: " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__);
JimCarver 0:6b753f761943 248 #else
JimCarver 0:6b753f761943 249 #define PAL_PRINTF( ARGS...) \
JimCarver 0:6b753f761943 250 PAL_LOG(DBG, ARGS);
JimCarver 0:6b753f761943 251 #endif
JimCarver 0:6b753f761943 252 #else
JimCarver 0:6b753f761943 253 #define PAL_PRINTF( ARGS...)
JimCarver 0:6b753f761943 254 #endif
JimCarver 0:6b753f761943 255
JimCarver 0:6b753f761943 256 #define DEBUG_PRINT(ARGS...) PAL_PRINTF(ARGS)
JimCarver 0:6b753f761943 257
JimCarver 0:6b753f761943 258 #define PAL_PTR_ADDR_ALIGN_UINT8_TO_UINT32 __attribute__((aligned(4)))
JimCarver 0:6b753f761943 259
JimCarver 0:6b753f761943 260 #define PAL_INT32_BITS (sizeof(int32_t) * CHAR_BIT)
JimCarver 0:6b753f761943 261
JimCarver 0:6b753f761943 262 #ifdef DEBUG
JimCarver 0:6b753f761943 263
JimCarver 0:6b753f761943 264
JimCarver 0:6b753f761943 265 #define PAL_VALIDATE_CONDITION_WITH_ERROR(condition, error) \
JimCarver 0:6b753f761943 266 {\
JimCarver 0:6b753f761943 267 if ((condition)) \
JimCarver 0:6b753f761943 268 { \
JimCarver 0:6b753f761943 269 PAL_LOG(ERR,"(%s,%d): Parameters values is illegal\r\n",__FUNCTION__,__LINE__); \
JimCarver 0:6b753f761943 270 return error; \
JimCarver 0:6b753f761943 271 } \
JimCarver 0:6b753f761943 272 }
JimCarver 0:6b753f761943 273 #define PAL_VALIDATE_ARGUMENTS(condition) PAL_VALIDATE_CONDITION_WITH_ERROR(condition,PAL_ERR_INVALID_ARGUMENT)
JimCarver 0:6b753f761943 274
JimCarver 0:6b753f761943 275 #else
JimCarver 0:6b753f761943 276 #define PAL_VALIDATE_ARGUMENTS(condition)
JimCarver 0:6b753f761943 277 #define PAL_VALIDATE_CONDITION_WITH_ERROR(condition, error)
JimCarver 0:6b753f761943 278 #endif
JimCarver 0:6b753f761943 279
JimCarver 0:6b753f761943 280
JimCarver 0:6b753f761943 281 #define PAL_VALIDATE_ARG_RLZ(condition, error) \
JimCarver 0:6b753f761943 282 {\
JimCarver 0:6b753f761943 283 if ((condition)) \
JimCarver 0:6b753f761943 284 { \
JimCarver 0:6b753f761943 285 return error; \
JimCarver 0:6b753f761943 286 } \
JimCarver 0:6b753f761943 287 }
JimCarver 0:6b753f761943 288
JimCarver 0:6b753f761943 289
JimCarver 0:6b753f761943 290
JimCarver 0:6b753f761943 291 #ifdef __cplusplus
JimCarver 0:6b753f761943 292 }
JimCarver 0:6b753f761943 293 #endif
JimCarver 0:6b753f761943 294 #endif //_PAL_MACROS_H