LPUART_DRV_SendDataPolling is risky

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPUART_DRV_SendDataPolling is risky

1,089 Views
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 Kudos
Reply
1 Reply

1,051 Views
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 Kudos
Reply