Merge pull request #3880 from adustm/fix_can2_only

DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated
pull/3829/head^2
Martin Kojtal 2017-03-06 16:57:57 +00:00 committed by GitHub
commit b2726470f6
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;
}