2008-04-29 07:30 AM
2011-05-17 12:52 AM
Change function CAN_SetBitrate to:
/******************************************************************************* * Function Name : CAN_SetBitrate * Description : Setups a standard CAN bitrate. * Input : bitrate: specifies the bit rate. * CAN_BITRATE_100K, * CAN_BITRATE_125K, * CAN_BITRATE_250K, * CAN_BITRATE_500K, * CAN_BITRATE_1M * Output : None * Return : None *******************************************************************************/ void CAN_SetBitrate(u8 bitrate) { CAN->BTR = CanTimings[bitrate]; /* write the predefined timing value */ CAN->BRPR = 0; /* clear the Extended Baud Rate Prescaler */ }