cancel
Showing results for 
Search instead for 
Did you mean: 

Major FUBAR in CAN stuff-91x_can.c

rgreenthal
Associate II
Posted on April 29, 2008 at 16:30

Major FUBAR in CAN stuff-91x_can.c

1 REPLY 1
rgreenthal
Associate II
Posted on May 17, 2011 at 09:52

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 */

}