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 get static obj's reference in C code?

Other Parts Discussed in Thread: TMS320C6748, SYSBIOS

hi , i am novice of Sys/bios.

I am working with sys/bios6.20, the hardware platform is based TMS320c6748.

It took me about 3 days to run "hello world" in my platform. [too slowly, i know that.]

Now I am trying to using thread staffs like SWI.

 

Here is my question: In graphical config interface, the static created obj is named as "ti.sysbios.swi0".

How can I manipulate it in .C code?

as i knows bios api need a Handle of that obj.

  • Take a look at http://rtsc.eclipse.org/cdoc-tip/xdc/cfg/Program.html#global and the example given there. When you create a static instance, the graphical config interface (xgconf) should automatically create a line:

    Program.global.<someName> = Mod.create(...);

    <someName> is a name you choose and must be a valid C variable name. That's the name you have to refer to in your C code, as describe in the link I referenced. In case you are using some older XDCtools, in which the line above is not generated automatically, then you'll have to add it.
    If you create a Swi instance as this:

    var swi0 = Swi.create(..);

    then you can just add

    Program.global.mySwi = swi0;

    and use mySwi in your C code.