diff --git a/ports/esp32/mphalport.c b/ports/esp32/mphalport.c index 2cf28b6c93e0b..a3701d9ca68bb 100755 --- a/ports/esp32/mphalport.c +++ b/ports/esp32/mphalport.c @@ -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; @@ -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)); }