Do you consider macros more or less readable than what you have?
A macro for that statement off the top of my heads is
Code:
#define writeShadow(S,R) while((S).CANMC.bit.CCR==0){(S).CANMC.all=(R).CANMC.all;};
Then you just say:
Code:
writeShadow(ECanaShadow,ECanaRegs)
I haven't tested that, but it should be close. I assume those are the structs that are going to change from statement to statement. Anyway it is a start if you like it.