Skip to content

Commit b272647

Browse files
authored
Merge pull request #3880 from adustm/fix_can2_only
DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated
2 parents bc8e2ec + 18c1618 commit b272647

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

targets/TARGET_STM/can_api.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void can_init(can_t *obj, PinName rd, PinName td)
4343
}
4444
#if defined(CAN2_BASE) && (CAN_NUM == 2)
4545
else if (obj->can == CAN_2) {
46+
__HAL_RCC_CAN1_CLK_ENABLE(); // needed to set filters
4647
__HAL_RCC_CAN2_CLK_ENABLE();
4748
obj->index = 1;
4849
}

0 commit comments

Comments
 (0)