scex additions
EIVE/eive-obsw/pipeline/head There was a failure building this commit Details

This commit is contained in:
Robin Müller 2022-05-26 12:04:27 +02:00
parent 97db44e500
commit 1276cc2dc6
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
8 changed files with 52 additions and 0 deletions

View File

@ -1,3 +1,4 @@
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include "InitMission.h"
#include <fsfw/objectmanager/ObjectManager.h>
@ -77,6 +78,28 @@ void initmission::initTasks() {
sif::error << "Add component TMTC Polling failed" << std::endl;
}
#if OBSW_ADD_SCEX == 1
PeriodicTaskIF* scexDevHandler = factory->createPeriodicTask(
"SCEX_DEV", 35, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc);
result = tmtcPollingTask->addComponent(objects::SCEX, DeviceHandlerIF::PERFORM_OPERATION);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = tmtcPollingTask->addComponent(objects::SCEX, DeviceHandlerIF::SEND_WRITE);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = tmtcPollingTask->addComponent(objects::SCEX, DeviceHandlerIF::GET_WRITE);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = tmtcPollingTask->addComponent(objects::SCEX, DeviceHandlerIF::SEND_READ);
if (result != HasReturnvaluesIF::RETURN_OK) {
initmission::printAddObjectError("SCEX_DEV", objects::SCEX);
}
result = tmtcPollingTask->addComponent(objects::SCEX, DeviceHandlerIF::GET_READ);
#endif
/* PUS Services */
std::vector<PeriodicTaskIF*> pusTasks;
createPusTasks(*factory, missedDeadlineFunc, pusTasks);
@ -109,6 +132,9 @@ void initmission::initTasks() {
#endif /* OBSW_ADD_TEST_CODE == 1 */
taskStarter(pstTasks, "PST Tasks");
#if OBSW_ADD_SCEX == 1
scexDevHandler->startTask();
#endif
#if OBSW_ADD_TEST_PST == 1
if (startTestPst) {
pstTestTask->startTask();

View File

@ -28,6 +28,7 @@
#define OBSW_ADD_RTD_DEVICES 0
#define OBSW_ADD_PL_PCDU 0
#define OBSW_ADD_TMP_DEVICES 0
#define OBSW_ADD_SCEX 1
#define OBSW_ADD_RAD_SENSORS 0
#define OBSW_ADD_SYRLINKS 0
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
@ -102,6 +103,12 @@
/*******************************************************************/
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
#define OBSW_USE_CCSDS_IP_CORE 0
// Set to 1 if all telemetry should be sent to the PTME IP Core
#define OBSW_TM_TO_PTME 0
// Set to 1 if telecommands are received via the PDEC IP Core
#define OBSW_TC_FROM_PDEC 0
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@

View File

@ -82,6 +82,10 @@ void ObjectFactory::produce(void* args) {
#endif
#endif
#if OBSW_ADD_SCEX == 1
createScexComponents(uart::DEV, pwrSwitcher);
#endif
#if OBSW_ADD_SUN_SENSORS == 1
createSunSensorComponents(gpioIF, spiComIF, pwrSwitcher, spi::DEV);
#endif

View File

@ -13,6 +13,12 @@ static constexpr char DEV[] = "/dev/spidev0.1";
}
namespace uart {
static constexpr char DEV[] = "/dev/serial0";
}
/* Adapt these values accordingly */
namespace gpio {
static constexpr uint8_t MGM_0_BCM_PIN = 17;

View File

@ -57,6 +57,7 @@ enum commonObjects : uint32_t {
PLOC_MPSOC_HANDLER = 0x44330015,
PLOC_SUPERVISOR_HANDLER = 0x44330016,
PLOC_SUPERVISOR_HELPER = 0x44330017,
SCEX = 0x44330032,
SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2,
HEATER_HANDLER = 0x444100A4,

View File

@ -319,8 +319,13 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
#endif // OBSW_ADD_RTD_DEVICES == 1
}
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF *pwrSwitcher) {
}
du findest
void ObjectFactory::gpioChecker(ReturnValue_t result, std::string output) {
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "ObjectFactory: Adding GPIOs failed for " << output << std::endl;
}
}

View File

@ -15,6 +15,8 @@ void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitc
void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher,
SpiComIF* comIF);
void createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher);
void gpioChecker(ReturnValue_t result, std::string output);
} // namespace ObjectFactory

View File

@ -1,4 +1,5 @@
#include "PdecHandler.h"
#include "OBSWConfig.h"
#include <fcntl.h>
#include <sys/mman.h>