TIMER_TICK_PER_SECOND redefined

Hi,

I wonder if anyone has the similar issue as my in SSP1.2.0 with e2studio 5.3.1

I want to change TIMER_TICK_PER_SECOND for the ThreadX so I add ThreadX source and set properties Timer Ticks Per Second to 1000. After the compilation, there are a few hundreds of warming messages about  "TIMER_TICKS_PER_SECOND redefined". By searching through the source files, it appears that the tx_user.h,  where this customized TIMER_TICKS_PER_SECOND is defined,  is inserted into the wrong location in tx_port.h. As shown below, the line 93 should be added before line 82. Though I made the change in tx_port.h and made this file Read Only for now to get rid of the warning messages, I'd like to know if there is a better way.  

Thanks,

Jimmy

 

  • Hi Jimmy,

    You should not edit the source files to make this change.  The proper way to do this is to add the source using the Synergy Configurator and then Edit the properties for the ThreadX module.  The property that you want to change is below:

     

    -Gary

  • In reply to garyj:

    Gary,

    it's exactly what I did. the source file shown in my post is generated by SSP automatically, which causes hundreds of warning messages. To eliminate these warning messages, I modified tx_port.h. however, I know it is not a right way to do but I do not have any other solutions for now.

    Could you please build your project with the timer tick per second set in the properties to find out how many warning messages generated? My project has a USB message storage class that uses many ux and threadX functions.

    Thanks,

    Jimmy
  • In reply to garyj:

    Hi all
    I join the discussion, even if my question is slightly different.
    What can I do to make task sleep call independent from ThreadX tick settings?
    In other hands, what is the method to call tx_thread_sleep(x) where x is the needed ticks value for 20msec?
    Abele
  • In reply to abe:

    Hello,

    Accurate delays can be done using hardware timer with semaphore and a helper function: renesasrulz.com/.../25526 .

    Regards
  • In reply to Renesas Karol:

    Karol

    yes shure ... but if you see the source of hal touch driver (on SSP1.2) there is a tx_thread_sleep(2) inside i2c functions ...

    I try to change ThreadX tick settings and this sleep will change and may become relevant

  • In reply to Jimmy:

    Hi Jimmy,

    If you modify the tx_src_user.h file in the synergy_cfg /framework/el folder in your project and add the following highlighted code:

    #if (1000+0)

    #ifdef TX_TIMER_TICKS_PER_SECOND

    #undef TX_TIMER_TICKS_PER_SECOND

    #endif

    #define TX_TIMER_TICKS_PER_SECOND (1000)

    #endif

     

    Then make the file read-only and build.

    This will eliminate the warning for the redefinition of the ticks but is not recommended because any property changes will not be updated in this file. 

    I still get 21 other warnings for unused parameters and type conversions...  This is all in the protected express logic code.

     

    -Gary

  • In reply to garyj:

    Gary,

    Thanks for the suggestion. I hope the future SSP release can fix this issue.

    Jimmy
  • In reply to Jimmy:

    + 1 vote on this issue
    But until they fix this issue, here's how I fixed it on my side to avoid manual modifications and lock of tx_src_user.h.
    In the Synergy Configurator, leave TX_TIMER_TICKS_PER_SECOND blank (default). Then add TX_TIMER_TICKS_PER_SECOND in the compiler symbol definitions.
  • In reply to abe:

    Abele,

    We have started using this in all of our tx_thread_sleep calls since we require redefined tick count on some projects but not others. (For example using Ubiquios it is required)

    tx_thread_sleep(TX_TIMER_TICKS_PER_SECOND/100*10); // 100ms sleep

    You can literally do a search and replace in a project to change this
    tx_thread_sleep(
    to this
    tx_thread_sleep(TX_TIMER_TICKS_PER_SECOND/100*

    Bill