Vern,
There is an issue with preprocessing the code.
I don't think token concatenation is what is is expected here:
Could you try to replace you macro(s):
#define WR_BIT(reg,bit,val) do {ptr->##reg##.##bit##=(val); _NOP();}while(0)
with
#define WR_BIT(reg,bit,val) do {ptr->reg.bit=(val); _NOP();}while(0)
NOTE:
I'd recommend you to use "Preprocess Selected File(s)" feature for debugging preprocessor related issues:


Hope it helps.
Stan