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.

CCS: How to open the header files in CCS?

Other Parts Discussed in Thread: MOTORWARE

Tool/software: Code Composer Studio

Very basic and totally frustrating.

I'm working my way through InstaSPIN foc labs. No the first time, I did this couple of years ago.

So I should know this, but I can't.

I've got the lab projects in my Eclipse/CCS5. I see the source files (.c) but not the headers (.h)

so where are they and how can I open them?

<RANTMODE>

I've been using Eclipse CDT for years and years and Eclipse Java for +10 years,

so I should be well versed in it. Yet it is unbelievable how difficult CCS is to use,

why have they re-invented the wheel and made it square? 

It wasn't broken so they should not have fingergepoken it! Argh, feel like screaming.

</RANTMODE>

  • Kustaa,

    Header files only show up directly in the file listing in Project Explorer if they have been explicitly added (or linked) to the project.  I know you are frustrated but we actually haven't re-invented anything there in CCS; that is the way Eclipse/CDT works.   

    In many cases people don't add the .h to the project they just setup the search path so the compiler can find the files.  I like adding the .h files to the project so that I can more easily find them.

    I think you are used to working with projects that are setup with the .h files directly added (or linked) and now you are working with some example projects that didn't do that.

    There is another way to see the header files.  If you expand a source file in the project explorer it will show the header files that are #included by that file.  You can then double click on the header file.  It will open the source file at the #include statement.  If you hit F3 it will then open the header file.  A bit of a pain but it generally works.

    This is a screen capture of what I am talking about in a CCS project:

    Here is the same thing in a CDT project

    Regards,

    John

  • Hi,

    I suspect you are using the Motorware, is that so? If so, I just imported the labs by following the instructions on the examples and the include directories passed to the project compiler options are shown under the Includes directory of the project. 

    However, the way these projects were designed is somewhat different from a more traditional way: one of the include paths is the top level directory where Motorware is installed ( ${MW_INSTALL_DIR} ) and the source files include the entire subpath to the specific header file.

    The arrangement of files in this package does not have a centralized location with all header files, therefore this was the method chosen by the package creators (out of many other possibilities). 

    To simplify the navigation of header files, you can simply click on the #include line above and hit the F3 key - it will automatically open the <adc.h> file shown in the example above. 

    In any case, Eclipse CDT is flexible enough that allows for each package creator to choose the method of their preference, thus it is difficult to normalize on a single approach.

    Hope this helps,

    Rafael 

  • Hi Guys,

    thanks for the help.

    This really helped me to understand the problem and find my way around.

    The F3 trick on #include is really what I need here.

    Now I understand that indeed it is not the CCS that is the culprit here but the "non traditional" way of setting up the project.

    Could and did fool me!

    I won't rant more but I will say that for tutorial project a "more traditional way" (gotta love the euphemism for <blank>) would have been much better choice. And no matter how a project is organised, it should be spelled out somewhere easily accessible place, especially if the organisation is what it is for motorware.

    As it is the whole motorware thing is a nightmare to navigate with files AND directories with identical names all over the place and so many files are almost identical in content too because of the lab exercises.

    Have to really really concentrate all the time to see the trees from forest and other way round too.

    A small nit pick: Eclipse does add all your files automatically (F5/Refresh) if the project is organised in "more traditional" way. To me it is mind-blowing that I have this much trouble just navigating around a relatively simple project like the lab exercises when just a few weeks ago I imported a pretty big C++ project (FreeCAD) into Eclipse and I had none of *these* problems.

    But enough of that, thank you very much people.

    wbr Kusti