This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to implement MSP430 hardware when creating library functions?



I would like to write a state machine library function that will require some MSP hardware (ie timer, UART).  Can someone tell me when you create a library where within the project do you set up the ISRs and configure the hardware required?  Does it get set up within it's own c file or as part of the same file?

I am new to creating libraries.  I guess I envision three files.

HWConfiguration.c

ISR.c

state machine.c

All compile to state machine.lib

Any comments on the appropriate way to do this would be appreciated.....

thanks

  • Organize it how you like. You are going to present an initialization function as part of your API. (Be sure to document that!) One thing to keep in mind is that order within the library may matter. I know it does when using the gcc tools.

    The linker scans the files in the library from first to last looking for symbols that resolve things that are undefined. So if you have a function in the second file that calls something in the first and that is the only reference to it, it will remain undefined.

**Attention** This is a public forum