mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/rtos2-utils.git
synced 2025-06-12 02:36:00 +00:00
51 lines
834 B
C++
51 lines
834 B
C++
#include <sta/os2/startup.hpp>
|
|
#ifdef STA_OS2_STARTUP_ENABLE
|
|
|
|
#include <sta/lang.hpp>
|
|
#include <sta/os2/system_event.hpp>
|
|
#include <sta/os2/watchdog.hpp>
|
|
|
|
#include <main.h>
|
|
|
|
#include <cmsis_os2.h>
|
|
|
|
|
|
#ifndef STA_OS2_STARTUP_ENTRY_FUNCTION
|
|
# define STA_OS2_STARTUP_ENTRY_FUNCTION startupTask
|
|
#endif // !STA_OS2_STARTUP_ENTRY_FUNCTION
|
|
|
|
|
|
namespace sta
|
|
{
|
|
// Provide weak implementation to allow overriding
|
|
STA_WEAK
|
|
void startupExtras(void *)
|
|
{}
|
|
} // namespace sta
|
|
|
|
|
|
// Declare with C linkage
|
|
extern "C"
|
|
{
|
|
void STA_OS2_STARTUP_ENTRY_FUNCTION(void * arg)
|
|
{
|
|
// Call further initialization code
|
|
sta::startupExtras(arg);
|
|
|
|
|
|
#ifdef STA_OS2_WATCHDOG_ENABLE
|
|
// Start timers
|
|
sta::startWatchdogTimer();
|
|
#endif
|
|
|
|
// Wake tasks
|
|
sta::signalStartupEvent();
|
|
|
|
// Terminate task
|
|
osThreadExit();
|
|
}
|
|
}
|
|
|
|
|
|
#endif // STA_OS2_STARTUP_ENABLE
|