Waiting for a flag to set - hangs

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

Waiting for a flag to set - hangs

ソリューションへジャンプ
747件の閲覧回数
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 解決策
707件の閲覧回数
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 返信
708件の閲覧回数
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.