12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef COMMON_H
- #define COMMON_H
- #include "at32f403a_407.h"
- #if defined ( __GNUC__ )
- #ifdef __packed
- #undef __packed
- #endif
- #define __packed __attribute__(( packed ))
- #endif
- #ifdef DEBUG
- #define DBG
- #else
- #undef DBG
- #define DBG if (0)
- #endif
- #define array_len(x) ((sizeof(x)/sizeof(0[x])) / ((size_t)(!(sizeof(x) % sizeof(0[x])))))
- #define _strc(x, y) x ## y
- #define strc(x, y) _strc(x, y)
- #define _str(x) #x
- #define str(x) _str(x)
- #define isInterrupt() ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0)
- #endif
|