Vitaliy wrote: > Timothy J. Weber wrote: >> So I list the things uart.c needs defined by the project in a separate >> uart-consts.h file, that the project duplicates and owns, and that is >> included by either uart.c or uart.h. SVN Update won't require merges, >> because this is committed to the project, not to the reuse library. But >> it contains boilerplate defines and comments describing what's needed. > > Main.h doesn't seem like an appropriate place for this code. So, the code > goes inside the Initializer object, which is project-specific. Once the > program starts up, main.c calls a procedure called > Initializer_InitializeAll(), which in turn calls (for example): > > p_InitializeAdc() > p_InitializeUart() > p_InitializeI2c() > > ...which are private functions inside the initializer.c module, and change > from project to project. p_InitializeUart would then call functions inside > the Uart module, such as Uart_SetBaudRate(), Uart_SetTxBufferSize(), etc, as > well as take care of the pin assignments. > > I hope this makes sense. Ah, I see - it's the same thing we've talked around before. I work on smaller chips, typically, and like to have this stuff optimized away by the compiler, so I'm thinking in terms of putting #defines in the right place; you're working on larger chips, so you're thinking of putting function calls in the right place. Those places are different. -- Timothy J. Weber http://timothyweber.org -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist