/**
 * @brief  Configures the SysTick clock source.
 * @param  CLKSource: specifies the SysTick clock source.
 *          This parameter can be one of the following values:
 *             @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
 *             @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
 * @retval None
 */
void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource) {
	/* Check the parameters */
	assert_param(IS_SYSTICK_CLK_SOURCE(CLKSource));
	if (CLKSource == SYSTICK_CLKSOURCE_HCLK) {
		SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK;
	} else {
		SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK;
	}
}
Beispiel #2
0
/**
 * \brief      Configures the SysTick clock source.
 * \param SysTick_CLKSource specifies the SysTick clock source.
 *             This parameter can be one of the following values:
 *                    SysTick_CLKSource_HCLK_Div8: AHB clock divided by 8
 *                    selected as SysTick clock source.
 *                    SysTick_CLKSource_HCLK: AHB clock selected as
 *                    SysTick clock source.
 */
void
SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource)
{
  /* Check the parameters */
  assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource));

  if(SysTick_CLKSource == SysTick_CLKSource_HCLK) {
    SysTick->CTRL |= SysTick_CLKSource_HCLK;
  } else {
    SysTick->CTRL &= SysTick_CLKSource_HCLK_Div8;
  }
}