mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-09-28 21:17:33 +00:00
Add HAL init
This commit is contained in:
22
src/hal/init.cpp
Normal file
22
src/hal/init.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <sta/hal/init.hpp>
|
||||
|
||||
#include <sta/assert.hpp>
|
||||
|
||||
#ifdef STA_HAL_DELAY_US_TIM
|
||||
#include <tim.h>
|
||||
#endif // STA_HAL_DELAY_US_TIM
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
void initHAL()
|
||||
{
|
||||
#ifdef STA_HAL_DELAY_US_TIM
|
||||
// Validate TIM used for delayUs
|
||||
extern bool isValidDelayUsTIM();
|
||||
STA_ASSERT(isValidDelayUsTIM());
|
||||
// Start timer base
|
||||
HAL_TIM_Base_Start(&STA_HAL_DELAY_US_TIM);
|
||||
#endif // STA_HAL_DELAY_US_TIM
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user