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.

Retrieving Event and Mailbox Handles from cfg script?

Other Parts Discussed in Thread: SYSBIOS

I have events and mailboxes defined in the cfg script like so:

var event0Params = new Event.Params();
event0Params.instance.name = "eventBC";
Program.global.event0 = Event.create(event0Params);

var mailbox0Params = new Mailbox.Params();
mailbox0Params.instance.name = "mailboxBC";
mailbox0Params.readerEvent = Program.global.event0;
mailbox0Params.readerEventId = 0x1;
Program.global.mailbox0 = Mailbox.create(128, 4, mailbox0Params);

How do I get the handle for these events?

  • Hi Darrell Faber,

    You should have a global C variable accessible in your application based on the "Program.global.<variable name>" name.

    The content of the *.cfg file is used to generate a .c file that's then built into your application.

    This generated .c file is found under the Debug or Release folder in your project.

    For example:

        Debug/configPkg/package/cfg/<project name>_<isa>.c

    So the mailbox code you have above:

        Program.global.mailbox0 = Mailbox.create(128, 4, mailbox0Params);

    Should cause something similar to the following to be generated in that .c file:

        const ti_sysbios_knl_Mailbox_Handle mailbox0 = (ti_sysbios_knl_Mailbox_Handle)((ti_sysbios_knl_Mailbox_Handle)&ti_sysbios_knl_Mailbox_Object__table__V[0]);

    Steve

  • I found that declaration in the generated .c file, however I am still unsure how to use this. mailbox0 is undefined when I try to use it.

  • Nevermind, added the extern declaration, and it works now. Thanks for your help.