WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
COMMON Types

宏定义

#define UNUSED(var)   do { (void)(var); } while (0)
 
#define MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
#define cassert(predicate, file)   impl_cassert_line(predicate, __LINE__, file)
 
#define impl_paste(a, b)   a##b
 
#define impl_cassert_line(predicate, line, file)    typedef char impl_paste(assertion_failed_##file##_, line)[2 * !!(predicate) - 1]
 
#define BIT(x)   (1UL << (uint32_t)(x))
 
#define ct_assert(e)   enum LENGTH_CHECK { ct_assert_value = 1 / ((!(!(e)))) }
 
#define __IRQ
 
#define __ISR   __IRQ
 

枚举

enum  ERROR_CODE_ENUM { ERR = -1 , SUCC = 0 }
 

详细描述

宏定义说明

◆ __IRQ

#define __IRQ

◆ __ISR

#define __ISR   __IRQ

◆ BIT

#define BIT (   x)    (1UL << (uint32_t)(x))

◆ cassert

#define cassert (   predicate,
  file 
)    impl_cassert_line(predicate, __LINE__, file)

A compile time assertion check.

Validate at compile time that the predicate is true without generating code. This can be used at any point in a source file where typedef is legal.

On success, compilation proceeds normally.

On failure, attempts to typedef an array type of negative size. The offending line will look like typedef assertion_failed_file_h_42[-1] where file is the content of the second parameter which should typically be related in some obvious way to the containing file name, 42 is the line number in the file on which the assertion appears, and -1 is the result of a calculation based on the predicate failing.

参数
predicateThe predicate to test. It must evaluate to something that can be coerced to a normal C boolean.
fileA sequence of legal identifier characters that should uniquely identify the source file in which this condition appears.

◆ ct_assert

#define ct_assert (   e)    enum LENGTH_CHECK { ct_assert_value = 1 / ((!(!(e)))) }

◆ impl_cassert_line

#define impl_cassert_line (   predicate,
  line,
  file 
)     typedef char impl_paste(assertion_failed_##file##_, line)[2 * !!(predicate) - 1]

◆ impl_paste

#define impl_paste (   a,
 
)    a##b

◆ MAX

#define MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))

◆ MIN

#define MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

◆ UNUSED

#define UNUSED (   var)    do { (void)(var); } while (0)

枚举类型说明

◆ ERROR_CODE_ENUM

枚举值
ERR 
SUCC