Conditional Includes in Assembler
I'm working on a project using the Keil C51 assembler on a Silicon
Labs EFM8BB2 project. We're trying to port it to a BB1 (now that we
have most of the features coded and the code is undergoing
compression to fit), but I'd like it to conditionally build for
What I currently have in an assembly file (the RAM test function)
is the following:
$IF (BB2 == 1)
;$include (SI_EFM8BB2_Defs.inc) ; SFR declarations
$include (SI_EFM8BB1_Defs.inc) ; SFR declarations
"BB2" or "BB1" is defined for the specific build. For the Debug
version, I'd like to leave it as BB2, because the debug code adds a
bunch of extra functionality: mostly putting strings out through the
UART port. (Most of the extra is actually storage of the strings
My problem is that if I uncomment the "BB2" include, the "BB1"
build fails because it can't find the SFR file. (I also set the
include paths according to the BB1/BB2 status.)
I should add that vice-versa applies.
I have just done an apparently successful build with both
uncommented by adding include paths for both SFR files. This builds
from the SiLabs IDE, but the command line build by our CI system
fails. I'm still trying to track that failure mode down.
Question: Is there a way to do the conditional include in the C51
assembler without having to add both include paths?