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的例程SerialAPP中的几个问题

问题1

Ln211行

SerialApp_RxSeq = 0xC3;
此处的0xC3是怎么得到的?

问题2

Ln 444行 

if ( (seqnb > SerialApp_RxSeq) || // Normal
((seqnb < 0x80 ) && ( SerialApp_RxSeq > 0x80)) ) // Wrap-around
此处的0x80代表什么?怎么得到的?

问题3

Ln 473-474行 
osal_set_event( SerialApp_TaskID, SERIALAPP_RESP_EVT );
osal_stop_timerEx(SerialApp_TaskID, SERIALAPP_RESP_EVT);
此处为什么要停止与SERIALAPP_RESP_EVT相联系的定时器,这个定时器是在什么地方启动的

  • 问题1,

    随机设定

    问题2,

    Seqnb每次都是自加1,所以比前一次大的都符合要求,另外因为这个变量只有8bit,所以判断是否加到256复位到0了

    问题3,

    set event是值这个事件立即触发,去执行这个事件,但是有可能这个事件的timer还在运行,所以需要立即关闭timer

  • 问题2

    ((seqnb < 0x80 ) && ( SerialApp_RxSeq > 0x80)

    如果是判断是否加到256复位到0

    那也应该是0xff啊?