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.

MSP430FR2355: Questions regarding public.h and private.h wrt .libc project

Part Number: MSP430FR2355

I am creating a lib.libc project in c. I have a public.h and a private.h.  The public.h will be shared with customers.   I am running into some compiler errors and wanted to ask a few questions:

1. I have a #define __TIMERB0 within the public.h . I then #include public.h within private.h. The private.h has #ifdef based on __TIMERB0. However CCS greys out my conditional in the private.h signaling that it doesn't recognize it. The question: Should I be able to do this?

2. Assuming I can do #1. At this point then it would suggest that I could just include private.h within my .c files that are used to create the library given that I have the #include public.h within private.h, correct?

Thanks

  • Hi Steve,

    I don't think you should include the public.h in private.h. You should include the specific module's .h in private.h.  
    For example, if public.h uses a,b,c and private.h uses a,d,e. you should include just a.h, d.h & e.h in private.h and not public.h.
  • Hi Eddie...

    Technically I was successful at it but it has become rather complicated and I am beginning to rethink.  For instance I have struct within the private.h but the public.h contains functions which use these structs as params.  Turns out in that instance I just did the following for example in public.h

    struct steve;

    Created empty structures that are sort of placeholders.  Anyway this is just one of the quagmires I am experiencing.  

    At the moment I think I will close this issue until I get a better grasp of my logic.

    Thanks

    Steve

  • Sounds good Steve!  I will close this one.  Feel free to post a new thread as new questions come up.

**Attention** This is a public forum