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.
Cluster List是z-stack中一个RAM开销大户,能否把Cluster List建立在Code区?
定义cluster时都有使用const,显然是放在code区。
const cId_t ipdInClusterList[IPD_MAX_INCLUSTERS] =
{
ZCL_CLUSTER_ID_GEN_BASIC,
ZCL_CLUSTER_ID_GEN_IDENTIFY,
ZCL_CLUSTER_ID_GEN_TIME,
ZCL_CLUSTER_ID_SE_PRICING,
ZCL_CLUSTER_ID_SE_MESSAGE
};
#define IPD_MAX_OUTCLUSTERS 5
const cId_t ipdOutClusterList[IPD_MAX_OUTCLUSTERS] =
{
ZCL_CLUSTER_ID_GEN_BASIC,
ZCL_CLUSTER_ID_GEN_IDENTIFY,
ZCL_CLUSTER_ID_GEN_TIME,
ZCL_CLUSTER_ID_SE_PRICING,
ZCL_CLUSTER_ID_SE_MESSAGE
};
Static and global objects declared const and located in memories using the memory
attributes __code, __far_code, and __huge_codeare allocated in ROM. For all
other memory attributes, the objects are allocated in RAM and initialized by the runtime
system at startup.
const只是表示不可变,但仍然放在RAM中