When I create a HWI or a Clock thread statically, i.e. in CCS using the .cfg-editor, I can provide an argument to be passed to the thread function:
for a HWI called "Argument passed to ISR function"
for a Clock called Thread Context > "Argument".
The .cfg-editor strips-off quotes and ampersands from the extered text, and nicely puts these back in the generated .cfg-file. E.g.:
/* * Application.Timer */ Clock.timerId = -1; var clock0Params = new Clock.Params(); clock0Params.instance.name = "clock0"; clock0Params.period = 1000; clock0Params.startFlag = true; clock0Params.arg = "&Application0"; Program.global.clock0 = Clock.create("&Application_Timer", 10, clock0Params);
With this configuration I expect to be able to cast the UArg argument of Application_Timer() to a pointer to the type of Application0, filled with the address of Application0. This is, however, not the case, as we can see in the generated code from this confifuration:
/* Object__table__V */ ti_sysbios_knl_Clock_Object__ ti_sysbios_knl_Clock_Object__table__V[1] = { {/* instance#0 */ { ((ti_sysbios_knl_Queue_Elem*)((void*)&ti_sysbios_knl_Clock_Module__state__V.Object_field_clockQ.elem)), /* next */ ((ti_sysbios_knl_Queue_Elem*)((void*)&ti_sysbios_knl_Clock_Module__state__V.Object_field_clockQ.elem)), /* prev */ }, /* elem */ (xdc_UInt32)0xa, /* timeout */ (xdc_UInt32)0xa, /* currTimeout */ (xdc_UInt32)0x3e8, /* period */ 1, /* active */ ((xdc_Void(*)(xdc_UArg))((xdc_Fxn)Application_Timer)), /* fxn */ ((xdc_UArg)((void*)"&Application0")), /* arg */ }, };
The argument 'arg' is a pointer to a string! Quotes and ampersand have not been removed as with the function name 'fxn'.
Is this a bug, or is this a feature?
I use CCS 5.5, xdctools_3_25_04_88, tirtos_1_20_00_28.