stmhal/hal: reapply HAL commit 9db719b
for f4
This commit is contained in:
parent
c79ff9930a
commit
4f7c5fa647
|
@ -337,10 +337,13 @@ __weak uint32_t HAL_GetTick(void)
|
||||||
*/
|
*/
|
||||||
__weak void HAL_Delay(__IO uint32_t Delay)
|
__weak void HAL_Delay(__IO uint32_t Delay)
|
||||||
{
|
{
|
||||||
uint32_t tickstart = 0U;
|
uint32_t start = HAL_GetTick();
|
||||||
tickstart = HAL_GetTick();
|
|
||||||
while((HAL_GetTick() - tickstart) < Delay)
|
// Note that the following works (due to the magic of 2's complement numbers)
|
||||||
{
|
// even when Delay causes wraparound.
|
||||||
|
|
||||||
|
while (HAL_GetTick() - start <= Delay) {
|
||||||
|
__WFI(); // enter sleep mode, waiting for interrupt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue