Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/09/10 05:39
Modified:
  06/09/10 05:52

Read: times


 
#176540 - A Rethink...
Responding to: ???'s previous message
Hmm...I'm starting to think my previously proposed solution to the problem of module-wide configuration visibility may not be the most appropriate one.

The configuration information I wish to make available to both parent and sub-component software modules seems to concern adapting each module to run on a specific hardware target. Consequently, a better name for the new module-wide configuration header file may be something like target.h. It's scope might then be extended to that of the single point of entry for now project-wide configurations, each of which relating specifically to adaptation of all project code to a single hardware target.

//file target.h

#ifndef TARGET_H
#define TARGET_H

#include "AT89C51RD2.h"      // The project's only reference to such a file.

#define TARGET_CPU_XTAL      22118400

#endif


//file Sio_poll.h

#ifndef SIO_POLL_H
#define SIO_POLL_H

#include "target.h"
#include "Delay.h"

#define SIO_POLL_XTAL        TARGET_CPU_XTAL      

#endif


//file Delay.h

#ifndef DELAY_H
#define DELAY_H

#include "target.h"

#define DELAY_XTAL           TARGET_CPU_XTAL   
   
#endif


End users of a software distribution structured this way, need only make a few minor changes to a single target.h file, for the entire project to then automatically adapt itself to run on their target hardware.

Does that sound a like a more orderly solution to anyone?

Regards,
Murray R. Van Luyn.

List of 34 messages in thread
TopicAuthorDate
Conditional SFR Declaration?            01/01/70 00:00      
   ReDef            01/01/70 00:00      
   Preprocessor -vs- Compiler            01/01/70 00:00      
      Thanks...            01/01/70 00:00      
   A Loosely Related Query?            01/01/70 00:00      
      .h file            01/01/70 00:00      
         Yep, that works!            01/01/70 00:00      
            I would not            01/01/70 00:00      
               Good question...            01/01/70 00:00      
            A Rethink...            01/01/70 00:00      
               I don't know ... but            01/01/70 00:00      
                  Agree with Michael            01/01/70 00:00      
                  An overthink.            01/01/70 00:00      
               #including #includes            01/01/70 00:00      
                  totally?            01/01/70 00:00      
                     re: really?            01/01/70 00:00      
   Still no luck...            01/01/70 00:00      
      Like I said before....            01/01/70 00:00      
      HAL            01/01/70 00:00      
      just curious            01/01/70 00:00      
         Nicely workable solution found...            01/01/70 00:00      
            Post vandalised!            01/01/70 00:00      
               What do you mean ...            01/01/70 00:00      
                  I mean this...            01/01/70 00:00      
                     Vandalism Highly Doubted            01/01/70 00:00      
                        Thanks Michael.            01/01/70 00:00      
      Define a new sfr?            01/01/70 00:00      
         RE: This assumes that location 0x8E is always the register            01/01/70 00:00      
         Simplest Solution?            01/01/70 00:00      
            I think HAL is less risky?            01/01/70 00:00      
               HAL very interesting...            01/01/70 00:00      
                  RE: might not be so immediately well understood            01/01/70 00:00      
                     Ah, now I see...            01/01/70 00:00      
                        No, you don't need a HAL header file for each variant!            01/01/70 00:00      

Back to Subject List