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.

How to set/get Clock_tickPeriod at runtime.

Other Parts Discussed in Thread: SYSBIOS

 

Hello,

I'm able to set the system tick period at configuration:

var ti_sysbios_knl_Clock = xdc.useModule('ti.sysbios.knl.Clock');
ti_sysbios_knl_Clock.tickPeriod = 1000; //1ms.

 

Now how to do this in the code. I also want to read it at runtime. How to do this?

Simon

tms570, ccs5.1, xdc 3.20.8.88

  • Simon,

    The C APIs are Clock_getPeriod() and Clock_setPeriod(). See:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/6_32_02_39/exports/bios_6_32_02_39/docs/cdoc/index.html#ti/sysbios/knl/Clock.html

    Mark

  • This is not what I'm searching for. These functions are specific to clock thread. Clock_getPeriod() for instance returns the period in number of tick.

    But I want to set and get the system tick (in microsecond).

    In ti/sysbios/knl/Clock.xdc, I see that there is getTickPeriod() which seem to be the function I'm searching for. But what is my handle?

    Keeping  my initial config code:

    var ti_sysbios_knl_Clock = xdc.useModule('ti.sysbios.knl.Clock');
    ti_sysbios_knl_Clock.tickPeriod = 1000; //1ms.

     

    How can I access   ti_sysbios_knl_Clock  in my C++ code?

    I want to do something like this:

    ...

    return ti_sysbios_knl_Clock->getTickPeriod();

    ...

    How can I inform the compiler the type of ti_sysbios_knl_Clock? Is it define in #include <xdc/cfg/global.h> ?

     

    Simon

     

  • Simon,

    Sorry, I mis-understood the question. You can use the global constant defined by the Clock module, Clock_tickPeriod. This represents the system tick period in units of microseconds. Documented in the same original URL.

    Mark