ESP_RETURN_ON_FALSE macro
Macro which can be used to check the condition. If the condition is not 'true', it prints the message and returns with the supplied 'err_code'.
Syntax
#define ESP_RETURN_ON_FALSE(a, err_code, log_tag, format, ...) do { \
if (unlikely(!(a))) { \
ESP_LOGE(log_tag, "%s(%d): " format, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
return err_code; \
} \
} while(0)
Examples
ESP_RETURN_ON_FALSE is referenced by 43 libraries and example projects: