added a delay check and updated README

This commit is contained in:
Iveta
2024-04-20 15:58:36 +03:00
parent 7cc6108a40
commit 3fe276f19d
4 changed files with 11 additions and 2 deletions

View File

@@ -62,10 +62,11 @@ namespace sta
return (updateFreq >= 1000000);
}
void delayUs(uint32_t us)
void delayUs(uint16_t us)
{
// Check if the specified timer is usable for microsecond delays.
STA_ASSERT(isValidDelayUsTIM());
STA_ASSERT(us < 1000);
__HAL_TIM_SET_COUNTER(&STA_STM32_DELAY_US_TIM, 0);
while (__HAL_TIM_GET_COUNTER(&STA_STM32_DELAY_US_TIM) < us * gDelayUsMul);