Hello
I've written a simple assembler macro and use it as follows:
#include
.macro WRITE_REG addr, val, reg0, reg1 ldr \reg0, =\addr /* store the address */ ldr \reg1, =\val /* store value */ str \reg1, [\reg0] /* write the value */ .endm .... WRITE_REG (MM3001_SMC_BASE + MM3001_SMC_SMBWST1R7), 0x0000001F, r0, r1 ... where MM3001_SMC_BASE and MM3001_SMC_SMBWST1R7 are defined in my_defs.h
My toolchain is ELDK-4.1 taken from
-fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -fno-builtin
-ffreestanding -nostdinc -pipe -mabi=apcs-gnu -march=armv5te -O0 -mbig-endian -ggdb
-mtune=arm926ej-s
Unluckily, it results in error:
Error: constant expression expected -- `ldr r0,=(MM3001_SMC_BASE+MM3001_SMC_SMBWST1R7)'
What might be the problem with the macro? Thanks.
-- Mark