Skip to content

Commit ec5160c

Browse files
committed
[bug][drv][cortex] Fix naming and docs for systick tick clock source
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent 3a303ba commit ec5160c

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/Include/bf0_hal_cortex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ typedef struct
9191
/** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick clock source
9292
* @{
9393
*/
94-
#define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000)
94+
#define SYSTICK_CLKSOURCE_TICK_CLK ((uint32_t)0x00000000)
9595
#define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004)
9696
/**
9797
* @}
@@ -407,7 +407,7 @@ uint32_t HAL_NVIC_GetEnableIRQ(IRQn_Type IRQn);
407407
* @brief Configure the SysTick clock source.
408408
* @param CLKSource: specifies the SysTick clock source.
409409
* This parameter can be one of the following values:
410-
* @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
410+
* @arg SYSTICK_CLKSOURCE_TICK_CLK: Tick clock selected as SysTick clock source.
411411
* @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
412412
* @retval None
413413
*/
@@ -482,7 +482,7 @@ void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
482482
#define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00)
483483

484484
#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \
485-
((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8))
485+
((SOURCE) == SYSTICK_CLKSOURCE_TICK_CLK))
486486

487487
#if (__MPU_PRESENT == 1)
488488
#define IS_MPU_REGION_ENABLE(STATE) (((STATE) == MPU_REGION_ENABLE) || \

drivers/hal/bf0_hal_cortex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ __HAL_ROM_USED uint32_t HAL_NVIC_GetEnableIRQ(IRQn_Type IRQn)
292292
* @brief Configure the SysTick clock source.
293293
* @param CLKSource: specifies the SysTick clock source.
294294
* This parameter can be one of the following values:
295-
* @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
295+
* @arg SYSTICK_CLKSOURCE_TICK_CLK: Tick clock selected as SysTick clock source.
296296
* @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
297297
* @retval None
298298
*/

example/bt/HCI_over_uart/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void ble_wvt_ble_power_on(void)
191191
SysTick->CTRL &= (SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk);
192192
HAL_RCC_HCPU_ClockSelect(RCC_CLK_MOD_HP_TICK, RCC_CLK_TICK_HXT48);
193193
HAL_SYSTICK_Config(800000 / RT_TICK_PER_SECOND);
194-
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK_DIV8);
194+
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_TICK_CLK);
195195
#endif
196196
}
197197

rtos/rtthread/bsp/sifli/drivers/drv_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ __ROM_USED void rt_hw_systick_init(void)
133133
HAL_Delay_us(200);
134134
HAL_RCC_HCPU_SetTickDiv(60);
135135
HAL_SYSTICK_Config(800000 / RT_TICK_PER_SECOND);
136-
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK_DIV8);
136+
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_TICK_CLK);
137137

138138
#else
139139

@@ -148,7 +148,7 @@ __ROM_USED void rt_hw_systick_init(void)
148148
HAL_SYSTICK_Config(32768 / 2 / RT_TICK_PER_SECOND);
149149
}
150150
//TODO: config clock source for 52x
151-
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK_DIV8);
151+
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_TICK_CLK);
152152
#else
153153
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq(CORE_ID_DEFAULT) / RT_TICK_PER_SECOND);
154154
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);

0 commit comments

Comments
 (0)