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
Solved! Go to Solution.
Fixewd the issue:
the following line:
while(!CANTFLG)
did not have {} after and thus the line following was never called.
Fixewd the issue:
the following line:
while(!CANTFLG)
did not have {} after and thus the line following was never called.