Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI C/C++ Compiler
Using compiler version 15.2.5 LTS, I'm trying to put a semaphore handle (which TI's headers define as a const pointer to an object) in a const structure to go into flash. The compiler seems to do the wrong thing and place the entire struct in RAM if the initializing assignment is another const datatype. The file is a C++ file.
typedef ti_sysbios_knl_Semaphore_Object* ti_sysbios_knl_Semaphore_Handle; const ti_sysbios_knl_Semaphore_Handle my_sem = &some_semaphore; struct mystruct { ti_sysbios_knl_Semaphore_Handle handle; } // is placed in .const const mystruct x = { .handle = 0 } // should be placed in .const but is placed in .data const mystruct y = { .handle = my_sem }