STM-can-api: Fixed variable name for H7

- can_frequency uses f instead of hz for can frequency
 - Also added comment to system_clock
pull/13565/head
m-ecry 2020-09-16 17:18:25 +02:00
parent 2a13fa199d
commit 73493b909a
2 changed files with 4 additions and 1 deletions

View File

@ -105,6 +105,9 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV6; RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV6;
//! 170MHz as a core frequency for FDCAN is not suitable for many frequencies,
//! as it provides low accuracy. When no FDCAN is used, the full capacity of 170 MHz
//! should be standard.
#if DEVICE_CAN #if DEVICE_CAN
RCC_OscInitStruct.PLL.PLLN = 80; RCC_OscInitStruct.PLL.PLLN = 80;
#else #else

View File

@ -287,7 +287,7 @@ int can_frequency(can_t *obj, int f)
#else #else
// STM32H7 doesn't support yet HAL_RCCEx_GetPeriphCLKFreq for FDCAN // STM32H7 doesn't support yet HAL_RCCEx_GetPeriphCLKFreq for FDCAN
// Internal ST ticket 92465 // Internal ST ticket 92465
int ntq = 10000000 / hz; int ntq = 10000000 / f;
#endif #endif
int nominalPrescaler = 1; int nominalPrescaler = 1;