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.

[参考译文] CC2530:Z-Stack 中的点和 osal_mem_alloc 用法

Guru**** 2540720 points
Other Parts Discussed in Thread: Z-STACK, CC2530

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/564992/cc2530-point-and-osal_mem_alloc-usage-in-z-stack

器件型号:CC2530
Thread 中讨论的其他器件:Z-stack

尊敬的所有人:

我使用了 CC2530 + Z-Stack 3.0。 以下代码无法将"6"分配给"g_pter"。 有人知道问题是什么? 非常感谢。

int *g_ptr; //全局指针  

void test( int *p )

p = osal_mem_alloc (sizeof (int));

*P=6;


void main (void)//我使用 main()来简化我的描述。 这应该是一个任务的初始化函数,例如 zclSampleSw_Init()


测试(g_ptr);

此致、

Barry

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您应该使用以下代码而不是您的代码:

    int *g_ptr;//全局指针
    G_PTR=osal_mem_alloc (sizeof (int));
    *G_PTR=6;