mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-12 01:25:59 +00:00
33 lines
457 B
C++
33 lines
457 B
C++
#include <sta/hal/delay.hpp>
|
|
#ifdef STA_HAL_DELAY_ENABLE
|
|
|
|
#include <main.h>
|
|
|
|
|
|
namespace sta
|
|
{
|
|
void delayMs(uint32_t ms)
|
|
{
|
|
HAL_Delay(ms);
|
|
}
|
|
} // namespace sta
|
|
|
|
|
|
#ifdef STA_HAL_DELAY_US_TIM
|
|
|
|
#include <tim.h>
|
|
|
|
namespace sta
|
|
{
|
|
void delayUs(uint32_t us)
|
|
{
|
|
__HAL_TIM_SET_COUNTER(&STA_HAL_DELAY_US_TIM, 0);
|
|
while (__HAL_TIM_GET_COUNTER(&STA_HAL_DELAY_US_TIM) < us);
|
|
}
|
|
} // namespace sta
|
|
|
|
#endif // STA_HAL_DELAY_US_TIM
|
|
|
|
|
|
#endif // STA_HAL_DELAY_ENABLE
|