Skip to content

Commit

Permalink
Update mphalport.c
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorNehrutsa committed Jul 18, 2023
1 parent 6b677a3 commit e007d31
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ports/esp32/mphalport.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
#include "uart.h"

#include "py/mpprint.h"
//#define DBG(...)
#define DBG(...) mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__); mp_printf(&mp_plat_print, "\n");
//#define PWM_DBG(...)
//#define PWM_DBG(...) mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__); mp_printf(&mp_plat_print, "\n");

TaskHandle_t mp_main_task_handle;

Expand Down Expand Up @@ -83,11 +83,7 @@ void check_esp_err_(esp_err_t code, const char* func, const int line, const char
o_str->len = strlen((char *)o_str->data);
o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
// raise
DBG("Exception in function '%s' at line %d in file '%s'", func, line, file)
/*
mp_obj_t args[2] = { MP_OBJ_NEW_SMALL_INT(pcode), MP_OBJ_FROM_PTR(o_str) };
nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 2, 0, args));
*/
PWM_DBG("Exception in function '%s' at line %d in file '%s'", func, line, file)
mp_obj_t args[5] = { MP_OBJ_NEW_SMALL_INT(pcode), MP_OBJ_FROM_PTR(o_str), mp_obj_new_str(func, strlen(func)), mp_obj_new_int(line), mp_obj_new_str(file, strlen(file)) };
nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 5, 0, args));
}
Expand Down

0 comments on commit e007d31

Please sign in to comment.