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,30 +5,24 @@
|
|||||||
#ifndef STA_RTOS_SYSTEM_STARTUP_HPP
|
#ifndef STA_RTOS_SYSTEM_STARTUP_HPP
|
||||||
#define 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
|
* @ingroup STA_RTOS_API
|
||||||
* @brief Startup system task.
|
* @brief Initializes rtos functions.
|
||||||
*
|
|
||||||
* Check @ref STA_RTOS_BuildConfig for configuration options.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace sta
|
namespace sta
|
||||||
{
|
{
|
||||||
namespace rtos
|
namespace rtos
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @brief Extra initialization run at start of startup task.
|
* @brief Initializes rtos functions.
|
||||||
*
|
*
|
||||||
* May be overridden by application if required.
|
* @ingroup STA_RTOS_Startup
|
||||||
*
|
*/
|
||||||
* @ingroup STA_RTOS_Startup
|
void initSystem();
|
||||||
*/
|
} // namespace rtos
|
||||||
void startupExtras(void * argument);
|
} // namespace sta
|
||||||
} // namespace rtos
|
|
||||||
} // namespace sta
|
|
||||||
|
|
||||||
|
|
||||||
#endif // STA_RTOS_SYSTEM_STARTUP_HPP
|
#endif // STA_RTOS_SYSTEM_STARTUP_HPP
|
||||||
|
@ -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/events.hpp>
|
||||||
#include <sta/rtos/system/watchdog.hpp>
|
#include <sta/rtos/system/watchdog.hpp>
|
||||||
#include <sta/devices/stm32/init.hpp>
|
|
||||||
|
|
||||||
#include <cmsis_os2.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace sta
|
namespace sta
|
||||||
{
|
{
|
||||||
namespace rtos
|
namespace rtos
|
||||||
{
|
{
|
||||||
// Provide weak implementation to allow overriding
|
|
||||||
STA_WEAK
|
|
||||||
void startupExtras(void *)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
void initSystem()
|
void initSystem()
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef STA_RTOS_SYSTEM_EVENTS_ENABLE
|
#ifdef STA_RTOS_SYSTEM_EVENTS_ENABLE
|
||||||
initSystemEvents();
|
initSystemEvents();
|
||||||
#endif // STA_RTOS_SYSTEM_EVENTS_ENABLE
|
#endif // STA_RTOS_SYSTEM_EVENTS_ENABLE
|
||||||
@ -35,30 +20,3 @@ namespace sta
|
|||||||
}
|
}
|
||||||
} // namespace rtos
|
} // namespace rtos
|
||||||
} // namespace sta
|
} // 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