8000 revert mphalport · micropython/micropython@7d821bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d821bb

Browse files
committed
revert mphalport
1 parent eb33120 commit 7d821bb

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

ports/esp32/mphalport.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,13 @@
4646
#include "usb_serial_jtag.h"
4747
#include "uart.h"
4848

49-
#include "py/mpprint.h"
50-
//#define PWM_DBG(...)
51-
#define PWM_DBG(...) mp_printf(MP_PYTHON_PRINTER, __VA_ARGS__); mp_printf(&mp_plat_print, "\n");
52-
5349
TaskHandle_t mp_main_task_handle;
5450

5551
STATIC uint8_t stdin_ringbuf_array[260];
5652
ringbuf_t stdin_ringbuf = {stdin_ringbuf_array, sizeof(stdin_ringbuf_array), 0, 0};
5753

5854
// Check the ESP-IDF error code and raise an OSError if it's not ESP_OK.
59-
//void check_esp_err(esp_err_t code) {
60-
void _check_esp_err(esp_err_t code, const char* func, const int line, const char *file) {
55+
void check_esp_err(esp_err_t code) {
6156
if (code != ESP_OK) {
6257
// map esp-idf error code to posix error code
6358
uint32_t pcode = -code;
@@ -83,11 +78,8 @@ void _check_esp_err(esp_err_t code, const char* func, const int line, const char
8378
o_str->len = strlen((char *)o_str->data);
8479
o_str->hash = qstr_compute_hash(o_str->data, o_str->len);
8580
// raise
86-
PWM_DBG("Exception in function '%s' at line %d in file '%s'", func, line, file)
87-
// mp_obj_t args[2] = { MP_OBJ_NEW_SMALL_INT(pcode), MP_OBJ_FROM_PTR(o_str) };
88-
// nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 2, 0, args));
89-
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)) };
90-
nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 5, 0, args));
81+
mp_obj_t args[2] = { MP_OBJ_NEW_SMALL_INT(pcode), MP_OBJ_FROM_PTR(o_str)};
82+
nlr_raise(mp_obj_exception_make_new(&mp_type_OSError, 2, 0, args));
9183
}
9284
}
9385

ports/esp32/mphalport.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ extern TaskHandle_t mp_main_task_handle;
5757
extern ringbuf_t stdin_ringbuf;
5858

5959
// Check the ESP-IDF error code and raise an OSError if it's not ESP_OK.
60-
//void check_esp_err(esp_err_t code);
61-
#define check_esp_err(code) _check_esp_err(code, __FUNCTION__, __LINE__, __FILE__)
62-
void _check_esp_err(esp_err_t code, const char* func, const int line, const char *file);
60+
void check_esp_err(esp_err_t code);
6361

6462
uint32_t mp_hal_ticks_us(void);
6563
__attribute__((always_inline)) static inline uint32_t mp_hal_ticks_cpu(void) {

0 commit comments

Comments
 (0)
0