#ifndef __PUBLIC_DIY_H__ #define __PUBLIC_DIY_H__ /* uint8_t 等定义在里面 */ #include "stdint.h" /* NULL定义在里面 */ #include "stdio.h" #ifndef RET_OK #define RET_OK (0u) #endif #ifndef RET_ERROR #define RET_ERROR (1u) #endif // 无效 #ifndef RET_INVALID #define RET_INVALID (0xFF) #endif #ifndef TRUE #define TRUE (1u) #endif #ifndef FALSE #define FALSE (0u) #endif /* 开关全局中断的宏 */ #define ENABLE_INT() __set_PRIMASK(0) /* 使能全局中断 */ #define DISABLE_INT() __set_PRIMASK(1) /* 禁止全局中断 */ #endif