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.

Multiple Platforms in one project?

Other Parts Discussed in Thread: TMS320F2812, TMS320F28035

Hi,

I have a codebase that I'm trying to port from the TMS320F2812 to the TMS320F28035.

I'm trying to prevent forking the project, so my plan has been to structure the code so that platform-independent code can be shared, and platform-specific code is only compiled when that platform is selected.

 

Current my directory structure is something like:

 

[Root Directory]

--> [includes] //Just the standard CCS ones

-->[Debug] //output directory

--> [src] //Common code, eg, SomeFunctions.c

-->[28035] //28035-specific code (eg, 28035MyCode.c)

-->[DSP2803x] //standard header / source stuff like DSP2803x_Comp.h, etc.

-->[TargetConfigFiles] //stuff like the platform-specific .CMD files and .CCXML files

-->[2812]

-->[DSP281x]

-->[TargetConfigFiles]

 

Is there a good way of conditionally including files, etc? Currently I have some #defines in the code (such as TARGET_PLATFORM), which include certain files at the preprocessor level.

I've just started populating the 28035 directory with the standard header files, and it's definitely complaining about that.

Is there a better way of doing this, or should I create two seperate CCS project (one for each platform)?

Could I create the equivalent of a Debug / Release build option (say, Debug2812 and Debug28035) that conditionally included the correct files for the platform?

Thanks,

Stewart

 

 

  • You could probably do this with etiher 2 separate projects or 2 build configurations in CCS. The defaults are Debug and Release but you can create your own configurations as you pointed out, like Debug2812 and Debug28035. Each configuration should exclude files that are not needed for that build.

    You can use compiler proprocessor directives to control the build and the current verions of linker also have preprocessing support for linker command files. This allows you to use preprocessing directives such as #define, #include, and #if/#endif in linker command files as well. This article contains an example of using this preprocessor support in the linker and could be helpful: http://tiexpressdsp.com/index.php/Using_Preprocessor_Support_in_Linker