summaryrefslogtreecommitdiff
path: root/esp8266/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-12-09 16:47:47 +1100
committerDamien George <damien.p.george@gmail.com>2016-12-09 16:51:49 +1100
commit45a6156dfd327f14f58c30ebf9159a92a5567ed5 (patch)
tree0e4d06d0be20ecaa7e610e4292580d71f4e97814 /esp8266/main.c
parent8e5aced1fd4845b23b203d8d15f9b34b6b022ceb (diff)
esp8266: Enable native emitter for Xtensa arch.
This patch allows esp8266 to use @micropython.native and @micropython.viper function decorators. By default the executable machine code is written to the space at the end of the iram1 region. The user can call esp.set_native_code_location() to make the code go to flash instead.
Diffstat (limited to 'esp8266/main.c')
-rw-r--r--esp8266/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/esp8266/main.c b/esp8266/main.c
index 5087c7d6a..1e988ef33 100644
--- a/esp8266/main.c
+++ b/esp8266/main.c
@@ -58,6 +58,10 @@ STATIC void mp_reset(void) {
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
MP_STATE_PORT(term_obj) = MP_OBJ_NULL;
MP_STATE_PORT(dupterm_arr_obj) = MP_OBJ_NULL;
+ #if MICROPY_EMIT_XTENSA
+ extern void esp_native_code_init(void);
+ esp_native_code_init();
+ #endif
pin_init0();
readline_init0();
dupterm_task_init();