DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated

pull/3930/head
adustm 2017-03-03 17:05:28 +01:00 committed by Anna Bridge
parent feb7569da7
commit deb7be1376
1 changed files with 1 additions and 0 deletions

View File

@ -43,6 +43,7 @@ void can_init(can_t *obj, PinName rd, PinName td)
}
#if defined(CAN2_BASE) && (CAN_NUM == 2)
else if (obj->can == CAN_2) {
__HAL_RCC_CAN1_CLK_ENABLE(); // needed to set filters
__HAL_RCC_CAN2_CLK_ENABLE();
obj->index = 1;
}