Cannot set CANBSEL to CANTFLG on MC9S12G128

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

Cannot set CANBSEL to CANTFLG on MC9S12G128

ソリューションへジャンプ
1,245件の閲覧回数
ilya_r
Contributor III


I am trying to send a CAN message but in the debugger the following lines of code are skipped:

 

do {

    CANTBSEL = CANTFLG;

  }while(!CANTBSEL);

 

here is the full function:

 

void CANMsgTX(J1939_MSG *MsgTX)
{
  volatile byte txbuffer;
  while(!CANTFLG)

 
  do  {
    CANTBSEL = CANTFLG;
  }while(!CANTBSEL);

    
  txbuffer = CANTBSEL;

 

  LoadMsgTX(MsgTX);

 

  CANTFLG = txbuffer;
}

 

 

thus CANBSEL and txbuffer stay at 0

ラベル(1)
タグ(4)
0 件の賞賛
返信
1 解決策
1,067件の閲覧回数
ilya_r
Contributor III

Fixewd the issue:

the following line:

while(!CANTFLG) 

did not have {} after and thus the line following was never called.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,068件の閲覧回数
ilya_r
Contributor III

Fixewd the issue:

the following line:

while(!CANTFLG) 

did not have {} after and thus the line following was never called.

0 件の賞賛
返信