Skip to content

Commit

Permalink
HardwareTimer: getTimerClkFreq() add comment to avoid confusion
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Bourdiol <[email protected]>
  • Loading branch information
ABOSTM authored and fpistm committed Jul 7, 2020
1 parent 348fdc4 commit 73633eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cores/arduino/HardwareTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ uint32_t HardwareTimer::getTimerClkFreq()
/* case RCC_APB2_DIV1: */
case RCC_APB2_DIV2:
case RCC_APB2_DIV4:
/* Note: in such cases, HCLK = (APBCLK * DIVx) */
uwTimclock = HAL_RCC_GetHCLKFreq();
break;
case RCC_APB1_DIV8:
Expand All @@ -1316,7 +1317,7 @@ uint32_t HardwareTimer::getTimerClkFreq()
case RCC_APB1_DIV2:
/* case RCC_APB2_DIV1: */
case RCC_APB2_DIV2:
// uwTimclock*=1;
/* Note: in such cases, HCLK = (APBCLK * DIVx) */
uwTimclock = HAL_RCC_GetHCLKFreq();
break;
case RCC_APB1_DIV4:
Expand Down Expand Up @@ -1349,6 +1350,7 @@ uint32_t HardwareTimer::getTimerClkFreq()
case RCC_HCLK_DIV1:
case RCC_HCLK_DIV2:
case RCC_HCLK_DIV4:
/* Note: in such cases, HCLK = (APBCLK * DIVx) */
uwTimclock = HAL_RCC_GetHCLKFreq();
break;
case RCC_HCLK_DIV8:
Expand Down

0 comments on commit 73633eb

Please sign in to comment.