diff options
Diffstat (limited to 'esp8266')
-rw-r--r-- | esp8266/Makefile | 1 | ||||
-rw-r--r-- | esp8266/modesp.c | 1 | ||||
-rw-r--r-- | esp8266/modmachine.c | 3 | ||||
-rw-r--r-- | esp8266/modpybpin.c | 3 | ||||
-rw-r--r-- | esp8266/utils.c | 50 | ||||
-rw-r--r-- | esp8266/utils.h | 29 |
6 files changed, 2 insertions, 85 deletions
diff --git a/esp8266/Makefile b/esp8266/Makefile index c49fdd2c25..6db8003ed8 100644 --- a/esp8266/Makefile +++ b/esp8266/Makefile @@ -76,7 +76,6 @@ SRC_C = \ moduos.c \ modmachine.c \ modonewire.c \ - utils.c \ ets_alt_task.c \ $(BUILD)/frozen.c \ fatfs_port.c \ diff --git a/esp8266/modesp.c b/esp8266/modesp.c index fd54ae0704..a6038ab39d 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -40,7 +40,6 @@ #include "user_interface.h" #include "espconn.h" #include "spi_flash.h" -#include "utils.h" #include "espneopixel.h" #include "modpyb.h" diff --git a/esp8266/modmachine.c b/esp8266/modmachine.c index c75f6e528d..c3c9494ac8 100644 --- a/esp8266/modmachine.c +++ b/esp8266/modmachine.c @@ -31,7 +31,6 @@ #include "py/runtime.h" #include "extmod/machine_mem.h" #include "extmod/machine_i2c.h" -#include "utils.h" #include "modpyb.h" #include "modpybrtc.h" @@ -137,7 +136,7 @@ STATIC mp_obj_t esp_timer_make_new(const mp_obj_type_t *type, mp_uint_t n_args, STATIC void esp_timer_cb(void *arg) { esp_timer_obj_t *self = arg; - call_function_1_protected(self->callback, self); + mp_call_function_1_protected(self->callback, self); } STATIC mp_obj_t esp_timer_init_helper(esp_timer_obj_t *self, mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/esp8266/modpybpin.c b/esp8266/modpybpin.c index a65911cbd1..ca2b87d935 100644 --- a/esp8266/modpybpin.c +++ b/esp8266/modpybpin.c @@ -37,7 +37,6 @@ #include "py/runtime.h" #include "py/gc.h" #include "modpyb.h" -#include "utils.h" #define GET_TRIGGER(phys_port) \ GPIO_PIN_INT_TYPE_GET(GPIO_REG_READ(GPIO_PIN_ADDR(phys_port))) @@ -105,7 +104,7 @@ void pin_intr_handler(uint32_t status) { if (status & 1) { mp_obj_t handler = MP_STATE_PORT(pin_irq_handler)[p]; if (handler != MP_OBJ_NULL) { - call_function_1_protected(handler, MP_OBJ_FROM_PTR(&pyb_pin_obj[p])); + mp_call_function_1_protected(handler, MP_OBJ_FROM_PTR(&pyb_pin_obj[p])); } } } diff --git a/esp8266/utils.c b/esp8266/utils.c deleted file mode 100644 index b2bdcffbe5..0000000000 --- a/esp8266/utils.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015 Josef Gajdusek - * Copyright (c) 2015 Paul Sokolovsky - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/runtime.h" -#include "py/obj.h" -#include "py/nlr.h" - -void call_function_1_protected(mp_obj_t fun, mp_obj_t arg) { - nlr_buf_t nlr; - if (nlr_push(&nlr) == 0) { - mp_call_function_1(fun, arg); - nlr_pop(); - } else { - mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); - } -} - -void call_function_2_protected(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2) { - nlr_buf_t nlr; - if (nlr_push(&nlr) == 0) { - mp_call_function_2(fun, arg1, arg2); - nlr_pop(); - } else { - mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val); - } -} diff --git a/esp8266/utils.h b/esp8266/utils.h deleted file mode 100644 index c6a4f1f3e6..0000000000 --- a/esp8266/utils.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2015 Josef Gajdusek - * Copyright (c) 2015 Paul Sokolovsky - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -void call_function_1_protected(mp_obj_t fun, mp_obj_t arg); -void call_function_2_protected(mp_obj_t fun, mp_obj_t arg1, mp_obj_t arg2); |