IMXRT1024 UART Interrupt Transfer Example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMXRT1024 UART Interrupt Transfer Example

ソリューションへジャンプ
1,944件の閲覧回数
Lukas_Frank
Senior Contributor I

Hi all, 

 

I wonder what happens if we don’t wait for send finished after LPUART_TransferSendNonBlocking in lpuart_interrupt_transfer example in SDK.

 

Exactly code line between 102-104. What happens if we delete these lines. Will data transmission fail for &xfer? Or exist any overflow with &sendXFer?

 

Thanks and Regards.

0 件の賞賛
返信
1 解決策
1,923件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

The API check if the busy flag to check if there an ongoing operation. So the best option would be to check the status that return the API to ensure the message was sent or not.

/* Return error if current TX busy. */
    if ((uint8_t)kLPUART_TxBusy == handle->txState)
    {
        status = kStatus_LPUART_TxBusy;
    }

Best Regard,

Alexis Andalon

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,934件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

The transmission will not fail, one of the reasons to use the NonBlocking functions is to continue the normal application flow until a transmission is received and the callback is triggered, in which case, the application will handle the oncoming packet.

Only you would need to be careful to not try to send a transmission until the callback notify that the current send operation is done.

Best Regards,
Alexis Andalon

0 件の賞賛
返信
1,928件の閲覧回数
Lukas_Frank
Senior Contributor I

Hi @Alexis_A ,

 

Thanks for your feedback. I wonder exactly what happens if I start new data transmission before last one’s callback is triggered?

 

Thanks and Regards.

0 件の賞賛
返信
1,924件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

The API check if the busy flag to check if there an ongoing operation. So the best option would be to check the status that return the API to ensure the message was sent or not.

/* Return error if current TX busy. */
    if ((uint8_t)kLPUART_TxBusy == handle->txState)
    {
        status = kStatus_LPUART_TxBusy;
    }

Best Regard,

Alexis Andalon

0 件の賞賛
返信