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.

TMS320F280039C: C2000Ware issue including both "driverlib.h" and "f28003x_device.h" in .cpp file

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

I have an empty .cpp file with the following:

#include "f28003x_device.h"

#include "driverlib.h"

This compiles OK.

(Side question:

How do you get web forms like this to stop inserting blank lines everywhere.

Just like this. Gaps are not needed here.

Now I have to highlight sections to clump them together instead of just eliminating blank lines.

Some lines belong close to each other.

The Modern UI is ridiculous.

More whitespace,

more, no

even more..

Scrolling all over is fun.

More whitespace!)

---------------------------------

However, if the lines are reversed:

#include "driverlib.h"

#include "f28003x_device.h"

 

It gets the errors: 

"C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f28003x\headers\include\f28003x_lin.h"

-- line 236: error #41: expected an identifier

"C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f28003x\headers\include\f28003x_lin.h"

-- line 236: error #80: expected a type specifier

"C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f28003x\headers\include\f28003x_lin.h"

-- line 236: error #66: expected a ";"

Clicking on the error takes me to f28003x_lib.h, line 236: 

bp_16 IDLE:1; // 2 SCI receiver in idle state (SCI compatible mode)

 

Basically, it trips up over "IDLE". "IDLE" is found in the following files:

C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f28003x\common\include\f28003x_globalprototypes.h 

-- Line 92 void IDLE(void);

C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f28003x\headers\include\f28003x_lin.h

-- 236 bp_16 IDLE:1; // 2 SCI receiver in idle state (SCI compatible mode)

C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f28003x\driverlib\cpu.h

-- 146 #ifndef IDLE
-- 147 #define IDLE __asm(" IDLE")
-- 150 #define IDLE_ASM __asm(" IDLE");

C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f28003x\driverlib\sysctl.h

1402 IDLE;
1440 IDLE;
1477 IDLE;

This is an issue because with a larger code base, many header files include other header files. Therefore, the order of header file inclusion is not (easily) determined. It seems like something needs to be fixed in the TI header files? Or, is it just forbidden to use these two header file sets together? This is, the user MUST select to use only library or only device_support?