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

@@ -85,6 +85,13 @@ Configuration:
TIM time base must be started before using `sta::delayUs` by calling `sta::initHAL`.
When using the startup system task this is handled automatically.
Steps to enable delayUs:
* Include sta/devices/stm32/delay.hpp in the file where the delayUs function is called
* Enable a timer TIM in .ioc file with the settings: Slave Mode=Disable, Trigger Mode=Disable, Clock Source=Internal Clock, all other channels =Disable)
* Define STA_STM32_DELAY_US_TIM in App/Inc/sta/config.hpp as the timer handle (can be found in Core/Inc/tim.h). For TIM1, this would be htim1
* Do not use this timer for delays of over 1000 us; we have delayMs for that
## Interfaces