Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions targets/TARGET_STM/hal_tick_16b.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ void timer_irq_handler(void)

#if defined(TARGET_STM32F0)
} // end timer_update_irq_handler function
// Used for mbed timeout (channel 1) and HAL tick (channel 2)

// Channel 1 used for mbed timeout
void timer_oc_irq_handler(void)
{
TimMasterHandle.Instance = TIM_MST;
Expand All @@ -49,7 +50,12 @@ void timer_oc_irq_handler(void)
}
}

// Reconfigure the HAL tick using a standard timer instead of systick.
// Overwrite the default ST HAL function (defined as "weak") in order to configure an HW timer
// used for mbed timeouts only (not used for the Systick configuration).
// Additional notes:
// - The default ST HAL_InitTick function initializes the Systick to 1 ms and this is not correct for mbed
// as the mbed Systick as to be configured to 1 us instead.
// - Furthermore the Systick is configured by mbed RTOS directly.
HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
// Enable timer clock
Expand Down
7 changes: 6 additions & 1 deletion targets/TARGET_STM/hal_tick_32b.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ void timer_irq_handler(void)
}
}

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