File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -45,3 +45,25 @@ char const *nrfx_error_string_get(nrfx_err_t code)
45
45
default : return "unknown" ;
46
46
}
47
47
}
48
+
49
+ char const * nrfx_new_error_string_get (int code )
50
+ {
51
+ #define NRFX_NEW_ERROR_STRING_CASE (code ) case code: return #code
52
+ switch (- code )
53
+ {
54
+ NRFX_NEW_ERROR_STRING_CASE (0 );
55
+ NRFX_NEW_ERROR_STRING_CASE (ECANCELED );
56
+ NRFX_NEW_ERROR_STRING_CASE (ENOMEM );
57
+ NRFX_NEW_ERROR_STRING_CASE (ENOTSUP );
58
+ NRFX_NEW_ERROR_STRING_CASE (EINVAL );
59
+ NRFX_NEW_ERROR_STRING_CASE (EINPROGRESS );
60
+ NRFX_NEW_ERROR_STRING_CASE (E2BIG );
61
+ NRFX_NEW_ERROR_STRING_CASE (ETIMEDOUT );
62
+ NRFX_NEW_ERROR_STRING_CASE (EPERM );
63
+ NRFX_NEW_ERROR_STRING_CASE (EFAULT );
64
+ NRFX_NEW_ERROR_STRING_CASE (EACCES );
65
+ NRFX_NEW_ERROR_STRING_CASE (EBUSY );
66
+ NRFX_NEW_ERROR_STRING_CASE (EALREADY );
67
+ default : return "unknown" ;
68
+ }
69
+ }
Original file line number Diff line number Diff line change @@ -128,6 +128,16 @@ LOG_MODULE_REGISTER(NRFX_MODULE_PREFIX, NRFX_MODULE_LOG_LEVEL);
128
128
#define NRFX_LOG_ERROR_STRING_GET (error_code ) nrfx_error_string_get(error_code)
129
129
extern char const * nrfx_error_string_get (nrfx_err_t code );
130
130
131
+ /**
132
+ * @brief Macro for getting the textual representation of a given errno error code.
133
+ *
134
+ * @param[in] error_code Errno error code.
135
+ *
136
+ * @return String containing the textual representation of the errno error code.
137
+ */
138
+ #define NRFX_NEW_LOG_ERROR_STRING_GET (error_code ) nrfx_new_error_string_get(error_code)
139
+ extern char const * nrfx_new_error_string_get (int code );
140
+
131
141
/** @} */
132
142
133
143
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments