Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void can_init(can_t *obj, PinName rd, PinName td)
obj->index = 0;
} else {
__HAL_RCC_CAN2_CLK_ENABLE();
obj->index = 0;
obj->index = 1;
}

// Configure the CAN pins
Expand Down Expand Up @@ -75,6 +75,9 @@ void can_init(can_t *obj, PinName rd, PinName td)

filter_number = (obj->can == CAN_1) ? 0 : 14;

// Set initial CAN frequency to 100kb/s
can_frequency(obj, 100000);

can_filter(obj, 0, 0, CANStandard, filter_number);
}

Expand Down Expand Up @@ -177,7 +180,7 @@ static unsigned int can_speed(unsigned int pclk, unsigned int cclk, unsigned cha

int can_frequency(can_t *obj, int f)
{
int pclk ; //= PeripheralClock;
int pclk = HAL_RCC_GetPCLK1Freq();
int btr = can_speed(pclk, (unsigned int)f, 1);
CAN_TypeDef *can = (CAN_TypeDef *)(obj->can);

Expand Down