Waiting for a flag to set - hangs

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

Waiting for a flag to set - hangs

跳至解决方案
768 次查看
jackboatman
Contributor II

Many of the various code examples have simple wait instructions. For example:

while (CAN_A.MCR.B.NOTRDY == 0) {};

And these generally work. However, I occasionally (often) find that they do not work. For example:

while (eSCI_B.IFSR1.B.TDRE == 0) {};

This one (checking for LIN to be ready) hangs; when I stop the debugger / halt execution it is just sitting on that line of code. I have in some cases created multiple lines of code to create an "equivalent" function, but that is sort of silly.

I'm using S32DS and mpc5777C. I've got most of the other peripherals (CAN, SPI, etc.) working. Any ideas?

1 解答
728 次查看
jackboatman
Contributor II

My bad. Was working too fast and was trying to use IFSR1.B.TDRE. I should have been using IFSR2.B.TXRDY.

Code seems to work okay now. Sorry for the distraction.

在原帖中查看解决方案

1 回复
729 次查看
jackboatman
Contributor II

My bad. Was working too fast and was trying to use IFSR1.B.TDRE. I should have been using IFSR2.B.TXRDY.

Code seems to work okay now. Sorry for the distraction.