mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Merge branch 'master' of https://github.com/cleanflight/cleanflight
This commit is contained in:
commit
1026dbde0b
1 changed files with 6 additions and 0 deletions
|
@ -99,6 +99,12 @@ uint32_t micros(void)
|
|||
do {
|
||||
ms = sysTickUptime;
|
||||
cycle_cnt = SysTick->VAL;
|
||||
|
||||
/*
|
||||
* If the SysTick timer expired during the previous instruction, we need to give it a little time for that
|
||||
* interrupt to be delivered before we can recheck sysTickUptime:
|
||||
*/
|
||||
asm volatile("\tnop\n");
|
||||
} while (ms != sysTickUptime);
|
||||
return (ms * 1000) + (usTicks * 1000 - cycle_cnt) / usTicks;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue