diff --git a/include/sta/rtos/c_api/startup.h b/include/sta/rtos/c_api/startup.h deleted file mode 100644 index 220436b..0000000 --- a/include/sta/rtos/c_api/startup.h +++ /dev/null @@ -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 diff --git a/include/sta/rtos/system/startup.hpp b/include/sta/rtos/system/startup.hpp index f3a2e46..f3e957a 100644 --- a/include/sta/rtos/system/startup.hpp +++ b/include/sta/rtos/system/startup.hpp @@ -5,30 +5,24 @@ #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. - * - * @ingroup STA_RTOS_Startup - */ - void startupExtras(void * argument); - } // namespace rtos -} // namespace sta + /** + * @brief Initializes rtos functions. + * + * @ingroup STA_RTOS_Startup + */ + void initSystem(); + } // namespace rtos +} // namespace sta #endif // STA_RTOS_SYSTEM_STARTUP_HPP diff --git a/src/system/startup.cpp b/src/system/startup.cpp index de6514d..6602034 100644 --- a/src/system/startup.cpp +++ b/src/system/startup.cpp @@ -1,29 +1,14 @@ -#include - -#include - -#include -#include -#include #include #include -#include - -#include 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(); - } -}