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.

using DELAY_US(A) - header files?

Other Parts Discussed in Thread: CONTROLSUITE

Hi folks

Q1)

I wish to use the asm function DELAY_US(A). I have copied and added the DSP2802x_usDelay.asm file to my project directory, and added the below code to the PeripheralHeaderIncludes.h file:

void DSP28x_usDelay(Uint32 Count);
#define CPU_RATE 16.667L // for a 60MHz CPU clock speed (SYSCLKOUT)
// DO NOT MODIFY THIS LINE.
#define DELAY_US(A) DSP28x_usDelay(((((long double) A * 1000.0L) / (long double)CPU_RATE) - 9.0L) / 5.0L)

The code has just been copied from DSP2802x_Examples.h and DSP2802x_GlobalPrototypes.h files.

Ive copied and pasted to avoid including these files (via the DSP28x_Project.h file) as they duplicate a lot of other stuff already included by the DSP2802x_PeripheralHeaderIncludes.h file

Is this the recommended way to do this?? Is there a more correct method??

Q2)

Also what is the way to remove unused header files from a project?

For example, before the modifications mentioned above, I had been including DSP2802x_Project.h, now I am not, yet it is still shown in the projects listing of included files....

If I try to right click > Delete the file from the project listing in the Project explorere pane, the entire project is deleted from the pane and I have to re-import it. 

When I do re-import it the offending header file is still there...

Many thanks

PiccoloControlSTICK F28027PT & CCS V 4.1.0.02005 



  • Hi Toby,

    Q1)

    That is an acceptable way to do that.  Right now controlSUITE is fragmented between the device support files and the kit files.  These are maintained by two different teams internally and things have a tendency to get out of sync.  We are currently working on restructuring our software to fix problems like this.  Look for a major overhaul of controlSUITE later this year.

    Q2)

    The reason it is deleting the whole project instead of just the header file is that you are trying to delete a file in the "includes" folder in the project navigator.  The includes folder in the project navigator displays the directories that are part of the include search path (i.e. files that will be found if you #include "file.h").  These files are not actually part of the project, but can be pulled in with a #include.  Only the files at the same indent level as "includes" can be deleted from a project.  Unless you have a header file that you have written and is in the project folder you should almost never have a *.h file show up in the project navigator along with the sources.  Does that make sense?


    Let me know if I can be of more assistance,

    Trey

  • Hi Trey

    Many thanks for your answers.

    1)

    Happy to see there is a major overhaul coming on the structure. While the examples are all good and well coded, it is very obvious they were coded by different groups with different standard operation ideas, meaning it can sometimes be hard to think about an example from the support files in the context of the kit files structure or vice versa. (if you see what I mean)

    Other than that I hope it will mean starting a new project will become easier :)

    2)

    I think I understand. You mean these files at sub-indent level, are only the files that are available, not necessarily actually included... is that correct?

    Again many thanks

  • Toby,

    1) I completely agree.

    2) Right.  The files in that include directory (the folder with the two blue rectangle icons) are files that could potentially be included but are not neccesarily included in the project.  Files below that are files that are actually part of the project and get compiled everytime you build.

    Trey