We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe73859 commit bef05ffCopy full SHA for bef05ff
ports/atmel-samd/tick.c
@@ -60,15 +60,13 @@ void tick_delay(uint32_t us) {
60
uint32_t ticks_per_us = common_hal_mcu_processor_get_frequency() / 1000 / 1000;
61
uint32_t us_until_next_tick = SysTick->VAL / ticks_per_us;
62
uint32_t start_tick;
63
- while (us > us_until_next_tick) {
+ while (us >= us_until_next_tick) {
64
start_tick=SysTick->VAL; // wait for SysTick->VAL to RESET
65
while (SysTick->VAL < start_tick) {}
66
us -= us_until_next_tick;
67
us_until_next_tick = 1000;
68
}
69
- if(us){
70
- while (SysTick->VAL > ((us_until_next_tick - us) * ticks_per_us)) {}
71
- }
+ while (SysTick->VAL > ((us_until_next_tick - us) * ticks_per_us)) {}
72
73
74
// us counts down!
0 commit comments