LPUART_DRV_SendDataPolling is risky

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPUART_DRV_SendDataPolling is risky

1,139 次查看
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

 

0 项奖励
回复
1 回复

1,101 次查看
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 项奖励
回复