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.

TMS320F28055: How to declare a variable correct?

Part Number: TMS320F28055


Hi.

I use a DPlib from controlSUITE. I'm in my main.c file declared next:

#pragma DATA_SECTION(CNTL_2P2Z_CoefStruct1, "CNTL_2P2Z_Coef");
#pragma DATA_SECTION(CNTL_2P2Z_CoefStruct2, "CNTL_2P2Z_Coef");

struct CNTL_2P2Z_CoefStruct CNTL_2P2Z_CoefStruct1;
struct CNTL_2P2Z_CoefStruct CNTL_2P2Z_CoefStruct2;

and next, I want to have access to declared variable in another some xxx.c file. How I most do correct declared it in another file?

the same problem and with

SineAnalyzer sine_mainsV = SineAnalyzer_DEFAULTS;

I need access to sine_mainsV in another xxx.c file.  How can I do it?

  • hi,

    you have to prototype the structure in a header file that is included by both .c files so in your case you would declare in the header file

    extern struct CNTL_2P2Z_CoefStruct CNTL_2P2Z_CoefStruct1;
    extern struct CNTL_2P2Z_CoefStruct CNTL_2P2Z_CoefStruct2;


    so you can define it as you shown in one .c file but still use it in another .c file