From d5d566dc65f31541ac159b3345e460b7002decad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 20 Aug 2023 10:15:43 -0500 Subject: [PATCH] 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". --- py/emitglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/emitglue.c b/py/emitglue.c index bb68f3d44b..d4d8439881 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -110,7 +110,7 @@ void mp_emit_glue_assign_native(mp_raw_code_t *rc, mp_raw_code_kind_t kind, void // so that the generated native code which was created in data RAM will // be available for execution from instruction RAM. #if MICROPY_EMIT_THUMB || MICROPY_EMIT_INLINE_THUMB - #if __ICACHE_PRESENT == 1 + #if defined(__ICACHE_PRESENT) && __ICACHE_PRESENT == 1 // Flush D-cache, so the code emitted is stored in RAM. MP_HAL_CLEAN_DCACHE(fun_data, fun_len); // Invalidate I-cache, so the newly-created code is reloaded from RAM.