refactor: removed starutp from rtos2-utils

This commit is contained in:
CarlWachter
2024-11-03 12:42:19 +01:00
parent cf1443891c
commit 345c74bdab
3 changed files with 11 additions and 81 deletions

View File

@@ -1,29 +1,14 @@
#include <sta/rtos/system/startup.hpp>
#include <sta/rtos/c_api/startup.h>
#include <sta/debug/assert.hpp>
#include <sta/lang.hpp>
#include <sta/rtos/system/can_bus.hpp>
#include <sta/rtos/system/events.hpp>
#include <sta/rtos/system/watchdog.hpp>
#include <sta/devices/stm32/init.hpp>
#include <cmsis_os2.h>
namespace sta
{
namespace rtos
{
// Provide weak implementation to allow overriding
STA_WEAK
void startupExtras(void *)
{}
void initSystem()
{
#ifdef STA_RTOS_SYSTEM_EVENTS_ENABLE
initSystemEvents();
#endif // STA_RTOS_SYSTEM_EVENTS_ENABLE
@@ -35,30 +20,3 @@ namespace sta
}
} // namespace rtos
} // namespace sta
void startALPAKA(void * arg)
{
STA_ASSERT_MSG(osKernelGetState() != osKernelInactive, "Cannot call startALPAKA() before osKernelInitialize()");
// Initialize HAL
sta::initHAL();
// Initialize RTOS system resources
sta::rtos::initSystem();
// Call further initialization code
sta::rtos::startupExtras(arg);
// Wake threads
#ifdef STA_RTOS_SYSTEM_EVENTS_ENABLE
sta::rtos::signalStartupEvent();
#endif // STA_RTOS_SYSTEM_EVENTS_ENABLE
// Check if called from thread
if (osThreadGetId() != nullptr)
{
// Terminate current thread
osThreadExit();
}
}