-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
ESP32: Check the ESP-IDF error code #6573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is the way it's done, but whether it's the best thing to do... not sure.
The idea here is that positive values indicate a "real" error code (i.e. MP_Exxx), and negative values are custom error code (i.e. ESP-IDF codes).
Your STATIC mp_obj_t mod_esp_err_EspError_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
...allocate and return an instance of _mp_obj_EspError_t
}
STATIC const mp_obj_type_t mod_esp_err_EspError_type = {
{ &mp_type_type },
.name = MP_QSTR_EspError,
.locals_dict = (void*)&mod_esp_err_EspError_locals_dict,
.make_new = mod_esp_err_EspError_make_new,
}; |
Thanks, Jim.
WIP |
This issue solved in PR #6638 |
I'll close this issue because points (2) and (3) are answered above. And point (1) is covered by #6638. |
idf.py fullclean make BOARD=GENERIC_C3 |
1) Is it correct to represent the ESP-IDF error code as OSError code?
For example, for the code
we get an output
But I expect to see
(or something similar) according to errors
from the
esp_err.h#L31
2) Is this line of code correct? Do you need a '-' here?
from the
mphalport.c#61
3) Is it possible to develop a C module with esp_err.py functionality?
esp_err.zip
I try but it doesn't work completely.
mod_esp_err.zip
I get TypeError when executing esp_err_test.py
The text was updated successfully, but these errors were encountered: