Dear, I am using S32K144 SDK RTM3.0,with FlexCAN and LPUART module,when I recieve can Msg, then tx using lpuart1, my problem:
1) I cant tx data twice using lpuart
2) I cant using the global varible in the while(1) loop
attachment is my project,thank you first
解決済! 解決策の投稿を見る。
Hello wdong
The function LPUART_DRV_SendData() is a non-blocking function, this means that the when you execute another function the transmission will be still on course. To avoid this you may check if the bus is busy before calling the second TX or use the function LPUART_DRV_SendDataBlocking().
The LPUART_DRV_SendDataBlocking() does not return until the transmit is complete.
Could you explain in detail the point 2? ("I cant using the global variable in the while(1) loop")
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar
Thank you, your solution is helpful. As for the second problem, I already know how to do. One must use volatile before the global value, so it can be used in the while(1) loop.
sorry, it is "volatile"
Hello wdong
The function LPUART_DRV_SendData() is a non-blocking function, this means that the when you execute another function the transmission will be still on course. To avoid this you may check if the bus is busy before calling the second TX or use the function LPUART_DRV_SendDataBlocking().
The LPUART_DRV_SendDataBlocking() does not return until the transmit is complete.
Could you explain in detail the point 2? ("I cant using the global variable in the while(1) loop")
Let me know if this is helpful, if you have more questions do not hesitate to ask me.
Best regards,
Omar