预编译时,使用了ZTOOL_P1,所以串口初始化时,回调函数uartConfig.callBackFunc = MT_UartProcessZToolData;,此MT_UartProcessZToolData函数从rxBuf读取数据。
比较疑惑的一点是,什么时候会触发MT_UartProcessZToolData函数的调用,是时间触发还是事件触发,还是其他情况也会触发?
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.
预编译时,使用了ZTOOL_P1,所以串口初始化时,回调函数uartConfig.callBackFunc = MT_UartProcessZToolData;,此MT_UartProcessZToolData函数从rxBuf读取数据。
比较疑惑的一点是,什么时候会触发MT_UartProcessZToolData函数的调用,是时间触发还是事件触发,还是其他情况也会触发?
Hi Zhenxing
Zstack中串口的回调函数由HalUARTPoll() 函数触发,在 Components\hal\common\hal_drivers.c文件下的Hal_ProcessPoll()函数里。
从整个系统角度来说,HalUARTPoll() 函数在osal_system_start()这个无限循环运行的函数里面被调用。
可参考:http://e2e.ti.com/support/low_power_rf/f/158/t/17886.aspx
可以具体参考SerialApp看看串口回调函数的触发即使用过程:
DMA方式下: HalUARTPollDMA 函数触发回调函数
HalUARTReadDMA 函数读取数据