Skip to content

Commit 3a4ebf5

Browse files
committed
esp8266: Enable inline Xtensa assembler.
With this patch, @micropython.asm_xtensa can be used on the esp8266 port.
1 parent f76b1bf commit 3a4ebf5

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

esp8266/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ STATIC void mp_reset(void) {
5858
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
5959
MP_STATE_PORT(term_obj) = MP_OBJ_NULL;
6060
MP_STATE_PORT(dupterm_arr_obj) = MP_OBJ_NULL;
61-
#if MICROPY_EMIT_XTENSA
61+
#if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA
6262
extern void esp_native_code_init(void);
6363
esp_native_code_init();
6464
#endif

esp8266/modesp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ STATIC mp_obj_t esp_esf_free_bufs(mp_obj_t idx_in) {
699699
}
700700
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_esf_free_bufs_obj, esp_esf_free_bufs);
701701

702-
#if MICROPY_EMIT_XTENSA
702+
#if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA
703703

704704
// We provide here a way of committing executable data to a region from
705705
// which it can be executed by the CPU. There are 2 such writable regions:
@@ -822,7 +822,7 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = {
822822
{ MP_OBJ_NEW_QSTR(MP_QSTR_malloc), (mp_obj_t)&esp_malloc_obj },
823823
{ MP_OBJ_NEW_QSTR(MP_QSTR_free), (mp_obj_t)&esp_free_obj },
824824
{ MP_OBJ_NEW_QSTR(MP_QSTR_esf_free_bufs), (mp_obj_t)&esp_esf_free_bufs_obj },
825-
#if MICROPY_EMIT_XTENSA
825+
#if MICROPY_EMIT_XTENSA || MICROPY_EMIT_INLINE_XTENSA
826826
{ MP_OBJ_NEW_QSTR(MP_QSTR_set_native_code_location), (mp_obj_t)&esp_set_native_code_location_obj },
827827
#endif
828828

esp8266/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define MICROPY_ALLOC_PARSE_CHUNK_INIT (64)
1212
#define MICROPY_PERSISTENT_CODE_LOAD (1)
1313
#define MICROPY_EMIT_XTENSA (1)
14+
#define MICROPY_EMIT_INLINE_XTENSA (1)
1415
#define MICROPY_MEM_STATS (0)
1516
#define MICROPY_DEBUG_PRINTERS (1)
1617
#define MICROPY_DEBUG_PRINTER_DEST mp_debug_print

esp8266/mpconfigport_512k.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#undef MICROPY_EMIT_XTENSA
44
#define MICROPY_EMIT_XTENSA (0)
5+
#undef MICROPY_EMIT_INLINE_XTENSA
6+
#define MICROPY_EMIT_INLINE_XTENSA (0)
57

68
#undef MICROPY_FSUSERMOUNT
79
#define MICROPY_FSUSERMOUNT (0)

0 commit comments

Comments
 (0)