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