Add function for configuring system interrupts
Add interrupt that monitors the following errors:
EPIM - CAN module has entered “error passive” mode
WLIM - One or both error counters (TX and RX) are >= 96
AAIM - A transmission request was aborted
Delete some old code
do{CanShadow_.CANTA.all=p_CanRegs_->CANTA.all;}// TODO add tx error somewhere here
do{CanShadow_.CANTA.all=p_CanRegs_->CANTA.all;}// TODO add tx error somewhere here
while((CanShadow_.CANTA.all&mboxControl)==0);// Wait for TA1 bit to be set
while((CanShadow_.CANTA.all&mboxControl)==0);// Wait for TA bit to be set
// Clear TA (transmit acknowledge bit)
CanShadow_.CANTA.all=0;
CanShadow_.CANTA.all=0;
CanShadow_.CANTA.all|=mboxControl;// Clear TA1
CanShadow_.CANTA.all|=mboxControl;
p_CanRegs_->CANTA.all=CanShadow_.CANTA.all;
p_CanRegs_->CANTA.all=CanShadow_.CANTA.all;
}
}
voidCAN::updateTXMessage(Uint16boxNumber,constCANMessage&message){// TODO check trs bit and set it at the end if it was here
voidCAN::updateTXMessage(Uint16boxNumber,constCANMessage&message){// TODO check trs bit and set it at the end if it was here. Once the TRS bit is set for a mailbox and then data is changed in the mailbox using the CDR
// bit, the CAN module fails to transmit the new data and transmits the old data instead. To avoid this,
// reset transmission in that mailbox using the TRRn bit and set the TRSn bit again. The new data is