2 Replies Latest reply on Jan 8, 2018 6:20 PM by AxLi_1746341

    threadX question

    DeXi_1316761

      In Wiced RTOS- ThreadX, how long(ms) is one tick? example: tx_thread_sleep(1).

        • 1. Re: threadX question
          PriyaM_16

          1 Timer tick is equivalent to 1msec.

          To support my statement:

          In platform.c file, the platform_tick_timer is initialized.

          platform_tick_timer_init() -> platform_tick_init() ->  platform_pmu_cycles_per_tick = CYCLES_PMU_PER_TICK;

           

          CYCLES_PMU_PER_TICK = ( ( ( (platform_reference_clock_get_freq( PLATFORM_REFERENCE_CLOCK_ILP )) + ( (1000) / 2 ) ) / (1000) ) )

          and PLATFORM_REFERENCE_CLOCK_ILP = 32000.

          (Note: Platform I have referred is: CYW943907AEVAL1F)

          2 of 3 people found this helpful
          • 2. Re: threadX question
            AxLi_1746341

            riya wrote:

             

            1 Timer tick is equivalent to 1msec.

            Don't assueme 1 tick as 1 ms.

            It's true for now as SYSTICK_FREQUENCY happen to be 1000, but there is no guarantee it won't be changed in the future.

            Use tx_thread_sleep((ULONG)(num_ms * SYSTICK_FREQUENCY / 1000)) instead.