Other Parts Discussed in Thread: CONTROLSUITE
We are developing code for motor control and we have started with HVPM_Sensorless_2833x exapmle project, now we want to have multiple .c files, and we added new "functions.c" file and its header, we have to include some header files both in the "HVPM_Sensorless.c" (default .c file that includes main function) and in the "functions.c" (new .c file). But we take building errors that is like this (problem is redefiniton):
...
"C:/ti/controlSUITE/device_support/f2833x/v132/DSP2833x_headers/cmd/DSP2833x_Headers_nonBIOS.cmd" "../F28335_RAM_HVPM_Sensorless.CMD" C:/ti/controlSUITE/libs/math/IQmath/v15c/lib/IQmath_fpu32.lib C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/lib/rts2800_fpu32_fast_supplement.lib
error: symbol "_ePWM" redefined: first defined in "./HVPM_Sensorless.obj";
redefined in "./Functions.obj"
error: symbol "_eCAP" redefined: first defined in "./HVPM_Sensorless.obj";
redefined in "./Functions.obj"
error: symbol "_eQEP" redefined: first defined in "./HVPM_Sensorless.obj";
>> Compilation failure
redefined in "./Functions.obj"
error: errors encountered during linking; "HVPM_Sensorless_2833x.out" not
built
gmake: *** [HVPM_Sensorless_2833x.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****
I know that the solution is using "extern" before declerations but this warning is about the TI's header files, I think the problem is f2833xdrvlib.h file, when I delete this include, there is no redefiniton error and build is ok but I have to use this include, variables in this file does not include extern and I added extern but there is no change, does struct needs extern? How can I fix that problem, I think this is about the TI's own header file (f2833xdrvlib.h)? We are waiting for your solution.
(the reason I include f2833xdrvlib.h is that: I must include "f2833xqep.h" and "f2833xpwm.h" and these two files include f2833xdrvlib.h. I could not understand the content of the f2833xdrvlib.h, i think it includes definitions, not declarations, why?)
Best Regards