超时宏定义
点击查看代码
#define CHECK_TIMEOUT(condition, msg) \do { \uint32_t timeout = 100000; \while(condition) { \if(timeout-- == 0) { \printf("[ERROR] %s | File: %s | Line: %d\r\n", msg, __FILE__, __LINE__); \return 0; \} \} \} while(0)
#define CHECK_TIMEOUT(condition, msg) \do { \uint32_t timeout = 100000; \while(condition) { \if(timeout-- == 0) { \printf("[ERROR] %s | File: %s | Line: %d\r\n", msg, __FILE__, __LINE__); \return 0; \} \} \} while(0)