63#define PAL_ERR_NO_MEM -2
66#ifndef PAL_ERR_INVALID_ARG
68#define PAL_ERR_INVALID_ARG -3
71#ifndef PAL_ERR_INVALID_STATE
73#define PAL_ERR_INVALID_STATE -4
76#ifndef PAL_ERR_INVALID_SIZE
78#define PAL_ERR_INVALID_SIZE -5
81#ifndef PAL_ERR_NOT_FOUND
83#define PAL_ERR_NOT_FOUND -6
86#ifndef PAL_ERR_NOT_SUPPORTED
88#define PAL_ERR_NOT_SUPPORTED -7
91#ifndef PAL_ERR_TIMEOUT
93#define PAL_ERR_TIMEOUT -8
96#ifndef PAL_ERR_INVALID_CRC
98#define PAL_ERR_INVALID_CRC -9
101#ifndef PAL_ERR_NOT_FINISHED
103#define PAL_ERR_NOT_FINISHED -10
106#ifndef PAL_ERR_NOT_ALLOWED
108#define PAL_ERR_NOT_ALLOWED -11
113#ifndef PAL_ERR_TO_NAME
128 case PAL_OK:
return "PAL_OK";
140 default:
return "unknown";
151#define PAL_ERR_TO_NAME(err) _pal_err_to_name(err)
165#define PAL_CHECK(x, tag, msg) \
168 if ((__ = (x)) != PAL_OK) { \
169 PAL_LOGE(tag, "%s (%s)", msg, PAL_ERR_TO_NAME(__)); \
186#define PAL_CHECK_COND(cond, tag, msg) \
189 PAL_LOGE(tag, msg); \
190 return PAL_ERR_INVALID_ARG; \
#define PAL_OK
Operation completed successfully.
Definition pal_err.h:53
#define PAL_ERR_NOT_ALLOWED
Operation is not permitted in the current context.
Definition pal_err.h:108
#define PAL_ERR_INVALID_CRC
CRC check failed.
Definition pal_err.h:98
#define PAL_ERR_NOT_FOUND
Requested resource was not found.
Definition pal_err.h:83
#define PAL_ERR_NOT_SUPPORTED
Operation or feature is not supported.
Definition pal_err.h:88
#define PAL_ERR_NO_MEM
Memory allocation failed.
Definition pal_err.h:63
int pal_err_t
Definition pal_err.h:44
#define PAL_ERR_TIMEOUT
Operation timed out.
Definition pal_err.h:93
static const char * _pal_err_to_name(pal_err_t err)
Convert a pal_err_t code to its human-readable name.
Definition pal_err.h:126
#define PAL_ERR_NOT_FINISHED
Operation has not finished yet.
Definition pal_err.h:103
#define PAL_ERR_INVALID_ARG
One or more arguments are invalid.
Definition pal_err.h:68
#define PAL_FAIL
Generic failure.
Definition pal_err.h:58
#define PAL_ERR_INVALID_SIZE
A size value is out of the valid range.
Definition pal_err.h:78
#define PAL_ERR_INVALID_STATE
The current state does not permit this operation.
Definition pal_err.h:73
ESP32 platform aliases for PAL error codes.