??? 06/09/10 01:38 Modified: 06/09/10 01:53 Read: times |
#176536 - Good question... Responding to: ???'s previous message |
BTW I AM curious, why do you not use a global SFR definition .h file?
Hi Erik, Yes, that's a very valid question. It must seem a very odd thing to want to do, to start adding special function register declarations to source code module headers. Why not simply use a register declaration header file that includes all the required declarations? If I had that option, then I would simply use a controller specific register declaration header file that covered everything. As the code I'm developing is for general distribution, then I'm worried that going this route may cause immediate problems for a percentage of the code's end users. I've chosen to stick with a minimal generic 8051 register declaration header file, as I feel this will earn me the least hate mail, and will hopefully work reliably for the greatest percentage of code recipients. The particular module I am developing may require access to a CKCON clock control register, if it is present on the target, though unfortunately such a register declaration does not appear in my generic 8051 register declaration header. The obvious and most conventional solution would be to simply add the missing register declaration to the generic register declaration header, but this leaves me with a header file that no longer adheres to it's specific function of generality. I'm not so sure I should be distributing such corruptions, so I've chosen to conditionally include the missing register declaration within my less mission-critical source code module instead. I hope that doesn't sound too silly a way of going about things. I'm just very concerned to be distributing source code modules that are easy to set-up and use, and that don't immediately disappoint those that please me by trying them. Regards, Murray R. Van Luyn. |