??? 06/15/10 15:46 Read: times |
#176691 - Define a new sfr? Responding to: ???'s previous message |
Why not define a sfr with a non-conflicting name in the module in question? You can have as many sfr declarations as you want which all point to the same memory address. That way, it doesn't matter if CKCON or CKCON0 is defined in the particular chip's header file
# In File: my_module.c sfr MY_CKCON = 0x8E; This assumes that location 0x8E is always the register you are looking for. Again, you'd have to include a note to the user that the exact address might have to be tweaked, but it seems like it would save you from the extra complication of using the preprocessor for this kind of thing. --David |