8000
We read every piece of feedback, and take your input very seriously.
8000 To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5572876 + 94866fc commit e5c7ff7Copy full SHA for e5c7ff7
ports/stm/common-hal/microcontroller/__init__.c
@@ -41,13 +41,14 @@
41
#include "supervisor/shared/safe_mode.h"
42
43
void common_hal_mcu_delay_us(uint32_t delay) {
44
- uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq() / 1000000;
+ uint32_t ticks_per_us = HAL_RCC_GetSysClockFreq() / 1000000UL;
45
delay *= ticks_per_us;
46
+ SysTick->VAL = 0UL;
47
SysTick->LOAD = delay;
48
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
49
while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0) {
50
}
- SysTick->CTRL = 0;
51
+ SysTick->CTRL = 0UL;
52
53
54
volatile uint32_t nesting_count = 0;
0 commit comments