Skip to content

Commit 1cef655

Browse files
committed
Add comments for HAL_InitTick function
1 parent 8d88bb0 commit 1cef655

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

targets/TARGET_STM/hal_tick_16b.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ void timer_oc_irq_handler(void)
4949
}
5050
}
5151

52-
// Reconfigure the HAL tick using a standard timer instead of systick.
52+
// Overwrite the default ST HAL function (defined as "weak") in order to configure an HW timer
53+
// used for mbed timeouts only (not used for the Systick configuration).
54+
// Additional notes:
55+
// - The default ST HAL_InitTick function initializes the Systick to 1 ms and this is not correct for mbed
56+
// as the mbed Systick as to be configured to 1 us instead.
57+
// - Furthermore the Systick is configured by mbed RTOS directly.
5358
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
5459
{
5560
// Enable timer clock

targets/TARGET_STM/hal_tick_32b.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ void timer_irq_handler(void)
3535
}
3636
}
3737

38-
// Reconfigure the HAL tick using a standard timer instead of systick.
38+
// Overwrite the default ST HAL function (defined as "weak") in order to configure an HW timer
39+
// used for mbed timeouts only (not used for the Systick configuration).
40+
// Additional notes:
41+
// - The default ST HAL_InitTick function initializes the Systick to 1 ms and this is not correct for mbed
42+
// as the mbed Systick as to be configured to 1 us instead.
43+
// - Furthermore the Systick is configured by mbed RTOS directly.
3944
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
4045
{
4146
RCC_ClkInitTypeDef RCC_ClkInitStruct;

0 commit comments

Comments
 (0)