py: Move call_function_*_protected() functions to py/ for reuse.
They almost certainly needed by any C code which calls Python callbacks.
diff --git a/esp8266/modmachine.c b/esp8266/modmachine.c
index c75f6e5..c3c9494 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 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) {