??? 06/16/10 08:12 Modified: 06/16/10 08:20 Read: times |
#176706 - Simplest Solution? Responding to: ???'s previous message |
Hi David,
Thanks for your helpful suggestions. Yes, I started out with a related solution, where I simply use a generic SFR declaration header file that doesn't have the CKCON declaration, and I then just add my own declaration to the module that requires it. As you and Andy have both pointed out, it's not a perfect solution, as there remains the possibility that the target device locates it's own CKCON SFR elsewhere. I became a little wary of going this route, as it introduces the prospect of 'silent failure' in cases where the target architecture is actually different, and where the end user is unaware of said occurrence. After mulling over some of the other thought provoking suggestions I received, I decided to go with a fairly simple solution, but one that relies heavily on the user having read the manual. The most user friendly solution I could devise was simply to rename the CKCON SFR register with a pre-compiler define statement, and ask the user to uncomment this re-definition as required, and where compilation will otherwise fail noticeably. #if (SIO_POLL_X2_MODE == 1) /** * Clock control special function register name redefinition. * Uncomment this redefinition for the original CKCON clock * control register in circumstances where your device-specific * SFR register declaration header file inconveniently renames * it as CKCON0. * hideinitializer */ // #define CKCON CKCON0 #endif That's probably not the best way to go, and I am certainly still open to further comments. I saw it as a fairly readily understandable work-around, however, so thought it an appropriately user-friendly fix for my unique coding situation. Regards, Murray R. Van Luyn. |