54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
#include "core/ObjectFactory.h"
|
|
#include "core/InitMission.h"
|
|
#include <stm32h7xx_nucleo.h>
|
|
#include <hardware_init.h>
|
|
|
|
#include <fsfw/objectmanager/ObjectManager.h>
|
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
|
#include <fsfw/serviceinterface/ServiceInterface.h>
|
|
#include <fsfw/timemanager/Clock.h>
|
|
|
|
#include <rtems.h>
|
|
#include <rtems/console.h>
|
|
#include <rtems/rtems/clock.h>
|
|
#include <mission/utility/compile_time.h>
|
|
|
|
#define BOARD_NAME "stm32h743zi-nucleo"
|
|
|
|
ObjectManagerIF *objectManager = nullptr;
|
|
|
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
|
ServiceInterfaceStream sif::debug("DEBUG", true);
|
|
ServiceInterfaceStream sif::info("INFO", true);
|
|
ServiceInterfaceStream sif::warning("WARNING", true);
|
|
ServiceInterfaceStream sif::error("ERROR", true);
|
|
#endif
|
|
|
|
/**
|
|
* @brief Core function for the RTEMS BSP, called in Init function.
|
|
* @return
|
|
* @author R. Mueller
|
|
*/
|
|
int main() {
|
|
hardware_init();
|
|
|
|
printf("\n\r%s-- FSFW Example (RTEMS) --\n", sif::ANSI_COLOR_RESET);
|
|
printf("-- Compiled for %s --\n", BOARD_NAME);
|
|
printf("-- Compiled on %s %s --\n\r",__DATE__, __TIME__);
|
|
|
|
timeval timeToSet;
|
|
timeToSet.tv_sec = UNIX_TIMESTAMP;
|
|
timeToSet.tv_usec = 0;
|
|
ReturnValue_t clockStatus = Clock::setClock(&timeToSet);
|
|
if(clockStatus != HasReturnvaluesIF::RETURN_OK) {
|
|
sif::printError("Clock configuration failed!\n");
|
|
}
|
|
else {
|
|
sif::printInfo("Clock configured successfully.\n");
|
|
}
|
|
objectManager = new ObjectManager(ObjectFactory::produce);
|
|
objectManager->initialize();
|
|
|
|
InitMission::createTasks();
|
|
}
|