added Assembly to FreeRTOS
This commit is contained in:
@ -1,23 +1,29 @@
|
||||
#include "InitMission.h"
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
#include <OBSWConfig.h>
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "pollingsequence/pollingSequenceFactory.h"
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include "mission/utility/TaskCreation.h"
|
||||
#include "mission/assemblies/TestAssembly.h"
|
||||
|
||||
#include <objects/systemObjectList.h>
|
||||
#include <mission/utility/TaskCreation.h>
|
||||
#include <pollingsequence/pollingSequenceFactory.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "fsfw/tasks/FixedTimeslotTaskIF.h"
|
||||
#include "fsfw/tasks/PeriodicTaskIF.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
|
||||
#include "fsfw/modes/HasModesIF.h"
|
||||
#include "fsfw/modes/ModeMessage.h"
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
||||
void InitMission::createTasks() {
|
||||
TaskFactory* taskFactory = TaskFactory::instance();
|
||||
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
/* TMTC Distribution */
|
||||
PeriodicTaskIF* distributerTask = TaskFactory::instance()->createPeriodicTask(
|
||||
PeriodicTaskIF* distributerTask = taskFactory->createPeriodicTask(
|
||||
"DIST", 5, 1024 * 2, 0.2, nullptr);
|
||||
ReturnValue_t result = distributerTask->addComponent(objects::CCSDS_DISTRIBUTOR);
|
||||
if(result!=HasReturnvaluesIF::RETURN_OK) {
|
||||
@ -128,6 +134,15 @@ void InitMission::createTasks() {
|
||||
sif::printError("InitMission::createTasks: Test PST initialization faiedl!\n");
|
||||
#endif
|
||||
}
|
||||
PeriodicTaskIF* assemblyTask = taskFactory->createPeriodicTask("ASS_TASK", 3,
|
||||
1024, 2.0, nullptr);
|
||||
if(assemblyTask == nullptr){
|
||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||
}
|
||||
result = assemblyTask->addComponent(objects::TEST_ASSEMBLY);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
task::printInitError("ASS_TASK", objects::TEST_ASSEMBLY);
|
||||
}
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||
|
||||
PeriodicTaskIF* testTask = TaskFactory::instance()->createPeriodicTask(
|
||||
@ -164,6 +179,7 @@ void InitMission::createTasks() {
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO == 1
|
||||
testDevicesTask->startTask();
|
||||
assemblyTask->startTask();
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO == 1 */
|
||||
|
||||
testTask->startTask();
|
||||
@ -177,5 +193,29 @@ void InitMission::createTasks() {
|
||||
static_cast<unsigned long>(xPortGetFreeHeapSize()));
|
||||
sif::printInfo("Tasks started..\n");
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_DEVICE_HANDLER_DEMO
|
||||
HasModesIF* assembly = objectManager->get<HasModesIF>(objects::TEST_ASSEMBLY);
|
||||
if (assembly == nullptr){
|
||||
return;
|
||||
}
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Waiting 5 Seconds and then command Test Assembly to Normal, Dual" << std::endl;
|
||||
#else
|
||||
sif::printInfo("Waiting 5 Seconds and then command Test Assembly to Normal, Dual \n");
|
||||
#endif
|
||||
|
||||
TaskFactory::delayTask(5000);
|
||||
CommandMessage modeMessage;
|
||||
ModeMessage::setModeMessage(&modeMessage, ModeMessage::CMD_MODE_COMMAND,
|
||||
DeviceHandlerIF::MODE_NORMAL, TestAssembly::submodes::DUAL);
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Commanding Test Assembly to Normal, Dual" << std::endl;
|
||||
#else
|
||||
sif::printInfo("Commanding Test Assembly to Normal, Dual \n");
|
||||
#endif
|
||||
MessageQueueSenderIF::sendMessage(assembly->getCommandQueue(), &modeMessage,
|
||||
MessageQueueIF::NO_QUEUE);
|
||||
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */
|
||||
}
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
#include <hardware_init.h>
|
||||
#include <lwip/init.h>
|
||||
#include <boardconfig.h>
|
||||
#include <OBSWVersion.h>
|
||||
#include "hardware_init.h"
|
||||
#include "lwip/init.h"
|
||||
#include "boardconfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
#include <common/utility/utility.h>
|
||||
#include "common/utility/utility.h"
|
||||
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
|
||||
#include <bsp_stm32_freertos/core/InitMission.h>
|
||||
#include <bsp_stm32_freertos/core/ObjectFactory.h>
|
||||
#include "bsp_stm32_freertos/core/InitMission.h"
|
||||
#include "bsp_stm32_freertos/core/ObjectFactory.h"
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <cmsis_os.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
#include <cstdio>
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
|
Reference in New Issue
Block a user