Skip to content

Commit df39831

Browse files
committed
Update mphalport.c
1 parent 7e18ba2 commit df39831

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ports/esp32/mphalport.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
#include "uart.h"
4949

5050
#include "py/mpprint.h"
51-
#define PWM_DBG(...) mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__); mp_printf(&mp_plat_print, "\n");
51+
52+
#define DEBUG 0
5253

5354
TaskHandle_t mp_main_task_handle;
5455

@@ -81,10 +82,12 @@ void check_esp_err_(esp_err_t code, const char* func, const int line, const char
8182
o_str->data = (const byte *)esp_err_to_name(code); // esp_err_to_name ret's ptr to const str
8283
o_str->len = strlen((char *)o_str->data);
8384
o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
85+
#if DEBUG
86+
mp_printf(MP_PYTHON_PRINTER, "Exception in function '%s' at line %d in file '%s'", func, line, file);
87+
#endif
8488
// raise
85-
PWM_DBG("Exception in function '%s' at line %d in file '%s'", func, line, file)
86-
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)) };
87-
nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 5, 0, args));
89+
mp_obj_t args[2] = { MP_OBJ_NEW_SMALL_INT(pcode), MP_OBJ_FROM_PTR(o_str)};
90+
nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 2, 0, args));
8891
}
8992
}
9093

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy