aboutsummaryrefslogtreecommitdiff
path: root/py/asmthumb.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-08-23 11:32:27 +1000
committerDamien George <damien.p.george@gmail.com>2017-08-23 11:32:27 +1000
commitf9ecaa132f44ca25e863bd76a0f9733fd7988503 (patch)
treedef8340bb2635b48b10d9c22ec3b965a3ac02efa /py/asmthumb.c
parent64a3c52f663b09e10d028ba711132e7f69f450ae (diff)
py/asmthumb: Use existing macro to properly clear the D-cache.
This macro is provided by stmhal/mphalport.h and makes sure the addr and size arguments are correctly aligned.
Diffstat (limited to 'py/asmthumb.c')
-rw-r--r--py/asmthumb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/asmthumb.c b/py/asmthumb.c
index 4360a6af9..5316a7efb 100644
--- a/py/asmthumb.c
+++ b/py/asmthumb.c
@@ -33,6 +33,7 @@
// wrapper around everything in this file
#if MICROPY_EMIT_THUMB || MICROPY_EMIT_INLINE_THUMB
+#include "py/mphal.h"
#include "py/asmthumb.h"
#define UNSIGNED_FIT8(x) (((x) & 0xffffff00) == 0)
@@ -53,7 +54,7 @@ void asm_thumb_end_pass(asm_thumb_t *as) {
#if defined(MCU_SERIES_F7)
if (as->base.pass == MP_ASM_PASS_EMIT) {
// flush D-cache, so the code emitted is stored in memory
- SCB_CleanDCache_by_Addr((uint32_t*)as->base.code_base, as->base.code_size);
+ MP_HAL_CLEAN_DCACHE(as->base.code_base, as->base.code_size);
// invalidate I-cache
SCB_InvalidateICache();
}