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 exclude files from include file path?

Other Parts Discussed in Thread: C2000WARE

Hi all,

I have some include directories that are required for my project. However, some of the files redeclare various macros since I am trying to merge an example project into my existing application project. The problem is that I can't figure out how to exclude or remove specific files from the include search path.

I know how to remove entire directories, but let's say I have a directory called Top. Inside Top there are three files: Top\myHeader1.h, Top\myHeader2.h, and Top\myHeader3.h. I set in the include options to search for the path: C:\Top\, but I only want to include two out of the three files in the Top directory.

Also, if there is an easier way to merge a C2000Ware example project with my application project please let me know!

I hope somebody can help me.

Thanks,

- Matthew

  • let's say I have a directory called Top. Inside Top there are three files: Top\myHeader1.h, Top\myHeader2.h, and Top\myHeader3.h. I set in the include options to search for the path: C:\Top\, but I only want to include two out of the three files in the Top directory.

    No file ever gets included automatically.  Some #include statement must specifically refer to it by name.  So, if this source line never appears ...

    #include <myHeader3.h>

    ... then that header file does not get included.  Another way to get that same effect ...  The #include statement appears, but is in a block controlled by a #if statement, and the condition for the #if is false.

    Please let me know if this explanation resolves the problem.

    Thanks and regards,

    -George

  • Thanks George, that makes sense. Is there a way to see which modules #include specific source files? For example, if myHeader3.h is causing a redefinition error, how can I find all the modules in my project that have #include "myHeader3.h" in them?

    I also noticed that my main application project uses the following source directories:

    And the project I am trying to incorporate into my main project includes the following source directories:

    As you can see, some of the directories are different, but I found that they contain similar modules such as uart.h, adc.h, but I also see modules named F2837xD_uart.h, F2837xD_adc.h. The problem is that some of the same (but not all) macros are defined in both. So when I include the source directory paths from the example project in my main project, redefinition errors appear. And if I omit those source directory paths, it says certain macros are undefined. I am having a hard time organizing and tracking down the files that I actually need to include.

    - Matthew

  • how can I find all the modules in my project that have #include "myHeader3.h" in them?

    This forum thread shows how to search a project.  

    As for the rest of your questions, this thread is passed over to the experts who know C2000Ware the best.

    Thanks and regards,

    -George

  • Thanks George, that makes sense. Is there a way to see which modules #include specific source files?

    The Eclipse IDE on which CCS is based contains an Include Browser - see https://downloads.ti.com/ccs/esd/training/ccs_tips-and-tricks.pdf

  • Matthew, 

    Is there any partiular reason for you to include the "deprecated" folder? Are you including any header files from this folder?

    If so, can you try to migrate to the driverlib folder "<C2000Ware>\\driverlib\f2837xd\driverlib" folder?

    Best Regards

    Siddharth

  • The project I am trying to merge with my main application is the sd_card_cpu01 example which uses the following source directories:

    It looks like hw_memmap.h, hw_uart.h, cmdline.h, and ustdlib.h (there might be others too) are in the "deprecated" folder and a ton of macros beginning with SYSCTL_PERIPH_XXXX are undefined if I don't include the "deprecated" folder. But if I do include "deprecated" I get a ton of warnings saying that macros have been redefined.

    - Matthew

  • Matthew, 

    Can you try using the driverlib folder located at C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2837xd as the include folder instead of using the deprecated folder The deprecated folder has content that is no longer supported and was mainly kept for backward compatibility. 

    Best Regards

    Siddharth

  • I tried, but the SD Card example project uses uart.h, systick.h, and rom.h which are only included in the "deprecated" folder.

  • Matthew, 

    I am what else cane be done to resolve this.

    Is it possible to share your code/project to take a look? 

    Best Regards

    Siddharth

  • I found a workaround. I found an SD card example for the F2838 and I just ported it for my device. It uses all the newest libraries and minimal source files. Thanks for your help.

  • Ok, glad that you were able to find a workaround. Will close this thread.

    Best Regards

    Siddharth