mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-10 01:55:59 +00:00
refactor: removed starutp from rtos2-utils
This commit is contained in:
parent
cf1443891c
commit
345c74bdab
@ -1,22 +0,0 @@
|
||||
#ifndef STA_RTOS_C_API_STARTUP_H
|
||||
#define STA_RTOS_C_API_STARTUP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
* @param arg Default task argument
|
||||
*/
|
||||
void startALPAKA(void * arg);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // STA_RTOS_C_API_STARTUP_H
|
@ -5,28 +5,22 @@
|
||||
#ifndef STA_RTOS_SYSTEM_STARTUP_HPP
|
||||
#define STA_RTOS_SYSTEM_STARTUP_HPP
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup STA_RTOS_Startup Startup task
|
||||
* @defgroup STA_RTOS_Startup RTOS Startup
|
||||
* @ingroup STA_RTOS_API
|
||||
* @brief Startup system task.
|
||||
*
|
||||
* Check @ref STA_RTOS_BuildConfig for configuration options.
|
||||
* @brief Initializes rtos functions.
|
||||
*/
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
namespace rtos
|
||||
{
|
||||
/**
|
||||
* @brief Extra initialization run at start of startup task.
|
||||
*
|
||||
* May be overridden by application if required.
|
||||
* @brief Initializes rtos functions.
|
||||
*
|
||||
* @ingroup STA_RTOS_Startup
|
||||
*/
|
||||
void startupExtras(void * argument);
|
||||
void initSystem();
|
||||
} // namespace rtos
|
||||
} // namespace sta
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user