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.

UCD3138A: ucd3138_PSFB_PCM Routine.

Part Number: UCD3138A
Other Parts Discussed in Thread: UCD3138

 Hi, TI Engineer。

 Recently, I was referring to the UCD3138_PSFB_PCM example, learning to use the configuration of uart, and found that the flags and arrays of the serial port receiving and sending in the variables.h file are all using extern define. At the same time, I did not find the original definitions of these flags and arrays in the entire project.
I hope you can help me see where the original definition is, and what libraries need to be added to my own project to use these arrays and flags.

  • We have a clever way of handling variables.  There is actually a #define for EXTERN that looks like this:

    #ifdef MAIN // If it is the main routine
    #define EXTERN // it isn't extern, so define it as nothing
    #else // If it isn't the main routine
    #define EXTERN extern // it is extern
    #endif

    And at the beginning of main.c, we have this:

    #define MAIN (1)//Declaring MAIN forces the EXTERN variables to be defined

    So the same variables.h file, when it is included in main.c, defines the variables without an extern.

    In any other file, they are declared with an EXTERN.