Skip to content

Commit d5d566d

Browse files
committed
Don't assume __ICACHE_PRESENT is defined
This seems to only be defined in cmsis files for M7 family MCUs, so it's not for e.g., makerdiary_m60_keyboard which enables loading of native code. Lower MCUs don't ever have icache, so the default is "off".
1 parent e74ef8b commit d5d566d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/emitglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void
110110
// so that the generated native code which was created in data RAM will
111111
// be available for execution from instruction RAM.
112112
#if MICROPY_EMIT_THUMB || MICROPY_EMIT_INLINE_THUMB
113-
#if __ICACHE_PRESENT == 1
113+
#if defined(__ICACHE_PRESENT) && __ICACHE_PRESENT == 1
114114
// Flush D-cache, so the code emitted is stored in RAM.
115115
MP_HAL_CLEAN_DCACHE(fun_data, fun_len);
116116
// Invalidate I-cache, so the newly-created code is reloaded from RAM.

0 commit comments

Comments
 (0)