Skip to content

Commit

Permalink
Fix building on F072RB
Browse files Browse the repository at this point in the history
  • Loading branch information
pazi88 committed Mar 26, 2024
1 parent a30339c commit aefb1b9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions STM32_CAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,17 @@ void STM32_CAN::begin( bool retransmission ) {
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_1;
#else
#if defined(GPIO_AF4_CAN)
GPIO_InitStruct.Alternate = GPIO_AF4_CAN;
#else
GPIO_InitStruct.Alternate = GPIO_AF9_CAN1;
#endif
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
#if defined(GPIO_SPEED_FREQ_VERY_HIGH)
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
#else
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
#endif
#endif
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
Expand Down

1 comment on commit aefb1b9

@pazi88
Copy link
Owner Author

@pazi88 pazi88 commented on aefb1b9 Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #32

Please sign in to comment.