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.

Clarifications about sine table in Iqmathtables



Hallo to everyone,

I am using the sine table from the iqmathtables all the time without problem, but I have some questions:

1.  When I use the following code what exactly I am telling to the compiler?

#pragma DATA_SECTION(sine_table,"IQmathTABLES");
_iq30 sine_table[512];

2. How does the compiler know that I am only using the sine table from the IQmathTables? If for example, I would like to use the tan table what should I write?

Thank you very much.

  • Ioannis,

    Ioannis Pallis said:

    1.  When I use the following code what exactly I am telling to the compiler?

    #pragma DATA_SECTION(sine_table,"IQmathTABLES");
    _iq30 sine_table[512];

    The _iq30 is just a typedef for long (32-bit value).  The pragma says to put the sine_table var into the linker section named IQmathTABLES.

    Ioannis Pallis said:

    2. How does the compiler know that I am only using the sine table from the IQmathTables? If for example, I would like to use the tan table what should I write?

    The section IQmathTables is linked in the linker .cmd table over the addresses where the IQmath tables reside in the ROM.  There are other tables in this section other than sine however.  They need to be linked in the correct order.

    There is no tan table in the ROM, so you couldn't use it.

    Regards,

    David