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".
This commit is contained in:
Jeff Epler 2023-08-20 10:15:43 -05:00
parent e74ef8b960
commit d5d566dc65
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
1 changed files with 1 additions and 1 deletions

View File

@ -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.