LPUART_DRV_SendDataPolling is risky

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

LPUART_DRV_SendDataPolling is risky

1,105件の閲覧回数
zhiguoguo
Contributor I

when two tasks call this function at the same time, it can cause it to go into an endless loop.

for example:

if one task is printing data , but task scheduling otther task. other task also print data. when it comlete print data, it would disable transmitter. if so , when come back to first task , it will go into  endless loop.

zhiguoguo_0-1726624940378.png

 

zgguo@iflytek.com
0 件の賞賛
返信
1 返信

1,067件の閲覧回数
PavelL
NXP Employee
NXP Employee

Hi,

it is a general issue when two tasks share the same HW resource - a workaround need to be programmed.

You need to use semaphore/mutex - see Semaphore (programming) - Wikipedia.  

Best regards,

Pavel

0 件の賞賛
返信