diff --git a/CMakeLists.txt b/CMakeLists.txt index 644b8bcd..f940ea0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,11 @@ set(LIB_ARCSEC_PATH ${THIRD_PARTY_FOLDER}/arcsec_star_tracker) set(LIB_JSON_PATH ${THIRD_PARTY_FOLDER}/json) set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF) -set(EIVE_ADD_LINUX_FILES False) +set(EIVE_ADD_LINUX_FILES OFF) + +if(UNIX) + set(EIVE_ADD_LINUX_FILES ON) +endif() # Analyse different OS and architecture/target options, determine BSP_PATH, # display information about compiler etc. diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index a3c94fe1..7e7bda14 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -6,11 +6,13 @@ #include #include #include -#include #include "OBSWConfig.h" +#include "devConf.h" #include "eive/definitions.h" +#include "fsfw/platform.h" #include "fsfw_tests/integration/task/TestTask.h" +#include "tmtc/pusIds.h" #if OBSW_USE_TMTC_TCP_BRIDGE == 0 #include "fsfw/osal/common/UdpTcPollingTask.h" @@ -47,6 +49,19 @@ #include "dummies/helpers.h" #include "mission/utility/GlobalConfigHandler.h" +#ifdef PLATFORM_UNIX +#include +#include + +#include "devices/gpioIds.h" +#include "fsfw_hal/linux/gpio/Gpio.h" +#include "linux/devices/ploc/PlocMPSoCHandler.h" +#include "linux/devices/ploc/PlocMPSoCHelper.h" +#include "linux/devices/ploc/PlocSupervisorHandler.h" +#include "linux/devices/ploc/PlocSupvUartMan.h" +#include "test/gpio/DummyGpioIF.h" +#endif + void Factory::setStaticFrameworkObjectIds() { PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_PACKET_DISTRIBUTOR; PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL; @@ -63,6 +78,33 @@ void ObjectFactory::produce(void* args) { CfdpTmFunnel* cfdpFunnel; ObjectFactory::produceGenericObjects(nullptr, &pusFunnel, &cfdpFunnel); + DummyGpioIF* dummyGpioIF = new DummyGpioIF(); + static_cast(dummyGpioIF); +#ifdef PLATFORM_UNIX + new SerialComIF(objects::UART_COM_IF); +#if OBSW_ADD_PLOC_MPSOC == 1 + std::string mpscoDev = ""; + auto mpsocCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, mpscoDev, uart::PLOC_MPSOC_BAUD, + mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); + mpsocCookie->setNoFixedSizeReply(); + auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER); + new PlocMPSoCHandler(objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocCookie, + plocMpsocHelper, Gpio(gpioIds::ENABLE_MPSOC_UART, dummyGpioIF), + objects::PLOC_SUPERVISOR_HANDLER); +#endif /* OBSW_ADD_PLOC_MPSOC == 1 */ +#if OBSW_ADD_PLOC_SUPERVISOR == 1 + std::string plocSupvString = ""; + auto supervisorCookie = + new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, plocSupvString, uart::PLOC_SUPV_BAUD, + supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); + supervisorCookie->setNoFixedSizeReply(); + auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER); + new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::PLOC_SUPERVISOR_HELPER, + supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, dummyGpioIF), + pcdu::PDU1_CH6_PLOC_12V, supvHelper); +#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ +#endif + dummy::DummyCfg cfg; dummy::createDummies(cfg); new TemperatureSensorsDummy(); diff --git a/bsp_linux_board/CMakeLists.txt b/bsp_linux_board/CMakeLists.txt index c1817ac1..39f06401 100644 --- a/bsp_linux_board/CMakeLists.txt +++ b/bsp_linux_board/CMakeLists.txt @@ -3,3 +3,4 @@ target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp add_subdirectory(boardconfig) add_subdirectory(boardtest) +add_subdirectory(fsfwconfig) diff --git a/linux/fsfwconfig/CMakeLists.txt b/bsp_linux_board/fsfwconfig/CMakeLists.txt similarity index 100% rename from linux/fsfwconfig/CMakeLists.txt rename to bsp_linux_board/fsfwconfig/CMakeLists.txt diff --git a/linux/fsfwconfig/FSFWConfig.h.in b/bsp_linux_board/fsfwconfig/FSFWConfig.h.in similarity index 100% rename from linux/fsfwconfig/FSFWConfig.h.in rename to bsp_linux_board/fsfwconfig/FSFWConfig.h.in diff --git a/linux/fsfwconfig/events/subsystemIdRanges.h b/bsp_linux_board/fsfwconfig/events/subsystemIdRanges.h similarity index 100% rename from linux/fsfwconfig/events/subsystemIdRanges.h rename to bsp_linux_board/fsfwconfig/events/subsystemIdRanges.h diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/bsp_linux_board/fsfwconfig/events/translateEvents.cpp similarity index 100% rename from linux/fsfwconfig/events/translateEvents.cpp rename to bsp_linux_board/fsfwconfig/events/translateEvents.cpp diff --git a/linux/fsfwconfig/events/translateEvents.h b/bsp_linux_board/fsfwconfig/events/translateEvents.h similarity index 100% rename from linux/fsfwconfig/events/translateEvents.h rename to bsp_linux_board/fsfwconfig/events/translateEvents.h diff --git a/linux/fsfwconfig/ipc/MissionMessageTypes.cpp b/bsp_linux_board/fsfwconfig/ipc/MissionMessageTypes.cpp similarity index 100% rename from linux/fsfwconfig/ipc/MissionMessageTypes.cpp rename to bsp_linux_board/fsfwconfig/ipc/MissionMessageTypes.cpp diff --git a/linux/fsfwconfig/ipc/MissionMessageTypes.h b/bsp_linux_board/fsfwconfig/ipc/MissionMessageTypes.h similarity index 100% rename from linux/fsfwconfig/ipc/MissionMessageTypes.h rename to bsp_linux_board/fsfwconfig/ipc/MissionMessageTypes.h diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/bsp_linux_board/fsfwconfig/objects/systemObjectList.h similarity index 96% rename from linux/fsfwconfig/objects/systemObjectList.h rename to bsp_linux_board/fsfwconfig/objects/systemObjectList.h index dba8c630..8f36b013 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/bsp_linux_board/fsfwconfig/objects/systemObjectList.h @@ -45,10 +45,8 @@ enum sourceObjects : uint32_t { ARDUINO_COM_IF = 0x49000000, CSP_COM_IF = 0x49050001, I2C_COM_IF = 0x49040002, - UART_COM_IF = 0x49030003, SPI_MAIN_COM_IF = 0x49020004, GPIO_IF = 0x49010005, - SCEX_UART_READER = 0x49010006, /* Custom device handler */ SPI_RW_COM_IF = 0x49020005, diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/bsp_linux_board/fsfwconfig/objects/translateObjects.cpp similarity index 100% rename from linux/fsfwconfig/objects/translateObjects.cpp rename to bsp_linux_board/fsfwconfig/objects/translateObjects.cpp diff --git a/linux/fsfwconfig/objects/translateObjects.h b/bsp_linux_board/fsfwconfig/objects/translateObjects.h similarity index 100% rename from linux/fsfwconfig/objects/translateObjects.h rename to bsp_linux_board/fsfwconfig/objects/translateObjects.h diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/bsp_linux_board/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp similarity index 100% rename from linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp rename to bsp_linux_board/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/bsp_linux_board/fsfwconfig/pollingsequence/pollingSequenceFactory.h similarity index 100% rename from linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h rename to bsp_linux_board/fsfwconfig/pollingsequence/pollingSequenceFactory.h diff --git a/linux/fsfwconfig/returnvalues/classIds.h b/bsp_linux_board/fsfwconfig/returnvalues/classIds.h similarity index 100% rename from linux/fsfwconfig/returnvalues/classIds.h rename to bsp_linux_board/fsfwconfig/returnvalues/classIds.h diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index bc46efb5..718594e1 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -593,7 +593,6 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit auto* camSwitcher = new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, pcdu::PDU2_CH8_PAYLOAD_CAMERA); camSwitcher->connectModeTreeParent(satsystem::pl::SUBSYSTEM); - // camSwitcher-> #if OBSW_ADD_PLOC_MPSOC == 1 consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER; auto gpioConfigMPSoC = new GpiodRegularByLineName(q7s::gpioNames::ENABLE_MPSOC_UART, diff --git a/common/config/devConf.h b/common/config/devConf.h index 88e78e1e..5f8164f6 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -1,11 +1,12 @@ #ifndef COMMON_CONFIG_DEVCONF_H_ #define COMMON_CONFIG_DEVCONF_H_ +#include + #include #include "fsfw/timemanager/clockDefinitions.h" #include "fsfw_hal/linux/spi/spiDefinitions.h" -#include "fsfw_hal/linux/uart/UartCookie.h" /** * SPI configuration will be contained here to let the device handlers remain independent diff --git a/linux/fsfwconfig/devices/addresses.h b/common/config/devices/addresses.h similarity index 100% rename from linux/fsfwconfig/devices/addresses.h rename to common/config/devices/addresses.h diff --git a/common/config/eive/objects.h b/common/config/eive/objects.h index 5b9ec8a0..e5192a82 100644 --- a/common/config/eive/objects.h +++ b/common/config/eive/objects.h @@ -16,6 +16,10 @@ enum commonObjects : uint32_t { PDEC_HANDLER = 0x50000700, CCSDS_HANDLER = 0x50000800, + /* 0x49 ('I') for Communication Interfaces **/ + UART_COM_IF = 0x49030003, + SCEX_UART_READER = 0x49010006, + /* 0x43 ('C') for Controllers */ THERMAL_CONTROLLER = 0x43400001, ACS_CONTROLLER = 0x43000002, diff --git a/fsfw b/fsfw index 2a203ae1..39946bff 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 2a203ae13d0b872189c0a79147c92312a44c08b1 +Subproject commit 39946bff58db7c5ac9016ca3156abb059560d9cb diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index d7e6ca93..7b99da46 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -3,7 +3,6 @@ add_subdirectory(utility) add_subdirectory(callbacks) add_subdirectory(boardtest) add_subdirectory(devices) -add_subdirectory(fsfwconfig) add_subdirectory(ipcore) target_sources(${OBSW_NAME} PUBLIC ObjectFactory.cpp InitMission.cpp) diff --git a/linux/InitMission.cpp b/linux/InitMission.cpp index 5bc8698c..4b7dc1f1 100644 --- a/linux/InitMission.cpp +++ b/linux/InitMission.cpp @@ -6,6 +6,7 @@ #include "OBSWConfig.h" #include "ObjectFactory.h" +#include "eive/objects.h" void scheduling::schedulingScex(TaskFactory& factory, PeriodicTaskIF*& scexDevHandler, PeriodicTaskIF*& scexReaderTask) { diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 2fe31372..21f884f9 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -5,9 +5,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index dc5a5e3b..ea314b4b 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -333,14 +333,12 @@ void SpiTestClass::performPeriodicMax1227Test() { } void SpiTestClass::performMax1227Test() { + std::string deviceName = ""; #ifdef XIPHOS_Q7S std::string deviceName = q7s::SPI_DEFAULT_DEV; #elif defined(RASPBERRY_PI) - std::string deviceName = ""; #elif defined(EGSE) - std::string deviceName = ""; #elif defined(TE0720_1CFA) - std::string deviceName = ""; #endif int fd = 0; UnixFileGuard fileHelper(deviceName, &fd, O_RDWR, "SpiComIF::initializeInterface"); @@ -381,8 +379,9 @@ void SpiTestClass::max1227RadSensorTest(int fd) { DiffSel::NONE_0); spiTransferStruct[0].len = 1; transfer(fd, gpioIds::CS_RAD_SENSOR); - max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), 7, spiTransferStruct[0].len); - size_t tmpLen = spiTransferStruct[0].len; + size_t tmpSz = spiTransferStruct[0].len; + max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), 7, tmpSz); + size_t tmpLen = tmpSz; spiTransferStruct[0].len = 1; transfer(fd, gpioIds::CS_RAD_SENSOR); std::memcpy(sendBuffer.data(), sendBuffer.data() + 1, tmpLen - 1); @@ -403,7 +402,8 @@ void SpiTestClass::max1227RadSensorTest(int fd) { for (int idx = 0; idx < 8; idx++) { sif::info << "ADC raw " << idx << ": " << adcRaw[idx] << std::endl; } - max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data(), spiTransferStruct[0].len); + tmpSz = spiTransferStruct[0].len; + max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data(), tmpSz); spiTransferStruct[0].len = 1; transfer(fd, gpioIds::CS_RAD_SENSOR); usleep(65); @@ -467,7 +467,8 @@ void SpiTestClass::max1227SusTest(int fd, SusTestCfg &cfg) { spiTransferStruct[0].len = 1; transfer(fd, cfg.gpioId); - max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), 5, spiTransferStruct[0].len); + size_t tmpSz = spiTransferStruct[0].len; + max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), 5, tmpSz); transfer(fd, cfg.gpioId); uint16_t adcRaw[6] = {}; adcRaw[0] = (recvBuffer[1] << 8) | recvBuffer[2]; @@ -552,10 +553,11 @@ void SpiTestClass::max1227PlPcduTest(int fd) { spiTransferStruct[0].len = 1; transfer(fd, gpioIds::PLPCDU_ADC_CS); uint8_t n = 11; - max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), n, spiTransferStruct[0].len); - size_t dummy = 0; + size_t tmpSz = spiTransferStruct[0].len; + max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), n, tmpSz); max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data() + spiTransferStruct[0].len, - dummy); + tmpSz); + spiTransferStruct[0].len = tmpSz; // + 1 to account for temp conversion byte spiTransferStruct[0].len += 1; transfer(fd, gpioIds::PLPCDU_ADC_CS); @@ -585,9 +587,11 @@ void SpiTestClass::max1227PlPcduTest(int fd) { spiTransferStruct[0].len = 1; transfer(fd, gpioIds::PLPCDU_ADC_CS); uint8_t n = 11; - max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), n, spiTransferStruct[0].len); + size_t tmpLen = spiTransferStruct[0].len; + max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), n, tmpLen); max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data() + spiTransferStruct[0].len, - spiTransferStruct[0].len); + tmpLen); + spiTransferStruct[0].len = tmpLen; transfer(fd, gpioIds::PLPCDU_ADC_CS); uint16_t adcRaw[n + 1] = {}; for (uint8_t idx = 0; idx < n + 1; idx++) { diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index 4f476d4b..1f707c8f 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -3,7 +3,7 @@ #include // Error integer and strerror() function #include // Contains file controls like O_RDWR #include -#include +#include #include #include #include @@ -13,6 +13,7 @@ #include #include "OBSWConfig.h" +#include "eive/objects.h" #include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/DleEncoder.h" #include "fsfw/globalfunctions/arrayprinter.h" diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 14d74322..6304724b 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include // Contains POSIX terminal control definitions #include diff --git a/linux/devices/ScexUartReader.cpp b/linux/devices/ScexUartReader.cpp index ca797e74..4606c921 100644 --- a/linux/devices/ScexUartReader.cpp +++ b/linux/devices/ScexUartReader.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include // write(), read(), close() #include // Error integer and strerror() function diff --git a/linux/devices/devicedefinitions/MPSoCReturnValuesIF.h b/linux/devices/devicedefinitions/MPSoCReturnValuesIF.h index 8a1085ca..032211e0 100644 --- a/linux/devices/devicedefinitions/MPSoCReturnValuesIF.h +++ b/linux/devices/devicedefinitions/MPSoCReturnValuesIF.h @@ -1,6 +1,7 @@ #ifndef MPSOC_RETURN_VALUES_IF_H_ #define MPSOC_RETURN_VALUES_IF_H_ +#include "eive/resultClassIds.h" #include "fsfw/returnvalues/returnvalue.h" class MPSoCReturnValuesIF { diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 6901d8fe..512a4950 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -8,8 +8,10 @@ #include #include #include -#include +#include + +#include "eive/resultClassIds.h" #include "mission/devices/devicedefinitions/SpBase.h" namespace supv { diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index a192365f..28513314 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -31,7 +31,7 @@ ReturnValue_t PlocMPSoCHandler::initialize() { if (result != returnvalue::OK) { return result; } - uartComIf = dynamic_cast(communicationInterface); + uartComIf = dynamic_cast(communicationInterface); if (uartComIf == nullptr) { sif::warning << "PlocMPSoCHandler::initialize: Invalid uart com if" << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; diff --git a/linux/devices/ploc/PlocMPSoCHandler.h b/linux/devices/ploc/PlocMPSoCHandler.h index fca65c7b..bd996006 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.h +++ b/linux/devices/ploc/PlocMPSoCHandler.h @@ -1,6 +1,8 @@ #ifndef BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ #define BSP_Q7S_DEVICES_PLOC_PLOCMPSOCHANDLER_H_ +#include + #include #include "PlocMPSoCHelper.h" @@ -10,7 +12,6 @@ #include "fsfw/ipc/QueueFactory.h" #include "fsfw/tmtcservices/SourceSequenceCounter.h" #include "fsfw_hal/linux/gpio/Gpio.h" -#include "fsfw_hal/linux/uart/UartComIF.h" #include "linux/devices/devicedefinitions/MPSoCReturnValuesIF.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" @@ -123,7 +124,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF { */ DeviceCommandId_t nextReplyId = mpsoc::NONE; - UartComIF* uartComIf = nullptr; + SerialComIF* uartComIf = nullptr; PlocMPSoCHelper* plocMPSoCHelper = nullptr; Gpio uartIsolatorSwitch; diff --git a/linux/devices/ploc/PlocMPSoCHelper.cpp b/linux/devices/ploc/PlocMPSoCHelper.cpp index 980b8889..fcd5178b 100644 --- a/linux/devices/ploc/PlocMPSoCHelper.cpp +++ b/linux/devices/ploc/PlocMPSoCHelper.cpp @@ -57,7 +57,7 @@ ReturnValue_t PlocMPSoCHelper::performOperation(uint8_t operationCode) { } ReturnValue_t PlocMPSoCHelper::setComIF(DeviceCommunicationIF* communicationInterface_) { - uartComIF = dynamic_cast(communicationInterface_); + uartComIF = dynamic_cast(communicationInterface_); if (uartComIF == nullptr) { sif::warning << "PlocMPSoCHelper::initialize: Invalid uart com if" << std::endl; return returnvalue::FAILED; diff --git a/linux/devices/ploc/PlocMPSoCHelper.h b/linux/devices/ploc/PlocMPSoCHelper.h index b669b51b..84a9f47f 100644 --- a/linux/devices/ploc/PlocMPSoCHelper.h +++ b/linux/devices/ploc/PlocMPSoCHelper.h @@ -1,6 +1,8 @@ #ifndef BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_ #define BSP_Q7S_DEVICES_PLOCMPSOCHELPER_H_ +#include + #include #include "fsfw/devicehandlers/CookieIF.h" @@ -9,7 +11,6 @@ #include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" #include "fsfw/tmtcservices/SourceSequenceCounter.h" -#include "fsfw_hal/linux/uart/UartComIF.h" #include "linux/devices/devicedefinitions/PlocMPSoCDefinitions.h" #ifdef XIPHOS_Q7S #include "bsp_q7s/fs/SdCardManager.h" @@ -136,7 +137,7 @@ class PlocMPSoCHelper : public SystemObject, public ExecutableObjectIF { * Communication interface of MPSoC responsible for low level access. Must be set by the * MPSoC Handler. */ - UartComIF* uartComIF = nullptr; + SerialComIF* uartComIF = nullptr; // Communication cookie. Must be set by the MPSoC Handler CookieIF* comCookie = nullptr; // Sequence count, must be set by Ploc MPSoC Handler diff --git a/linux/devices/ploc/PlocMemoryDumper.h b/linux/devices/ploc/PlocMemoryDumper.h index da72c558..4a4e05bf 100644 --- a/linux/devices/ploc/PlocMemoryDumper.h +++ b/linux/devices/ploc/PlocMemoryDumper.h @@ -5,7 +5,12 @@ #include #include "OBSWConfig.h" + +#ifdef XIPHOS_Q7S #include "bsp_q7s/fs/SdCardManager.h" +#endif + +#include "eive/eventSubsystemIds.h" #include "fsfw/action/ActionHelper.h" #include "fsfw/action/CommandActionHelper.h" #include "fsfw/action/CommandsActionsIF.h" @@ -13,7 +18,7 @@ #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" -#include "linux/fsfwconfig/objects/systemObjectList.h" +#include "objects/systemObjectList.h" /** * @brief Because the buffer of the linux tty driver is limited to 2 x 65535 bytes, this class is diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index b6783449..ddfd3733 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -49,7 +49,7 @@ ReturnValue_t PlocSupervisorHandler::initialize() { if (result != returnvalue::OK) { return result; } -#ifndef TE0720_1CFA +#ifdef XIPHOS_Q7S sdcMan = SdCardManager::instance(); #endif /* TE0720_1CFA */ if (supvHelper == nullptr) { @@ -1761,7 +1761,7 @@ ReturnValue_t PlocSupervisorHandler::createMramDumpFile() { std::string filename = "mram-dump--" + timeStamp + ".bin"; -#ifndef TE0720_1CFA +#ifdef XIPHOS_Q7S std::string currentMountPrefix = sdcMan->getCurrentMountPrefix(); #else std::string currentMountPrefix("/mnt/sd0"); diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index 174ffa9e..a5b0a2ae 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -1,18 +1,21 @@ #ifndef MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ #define MISSION_DEVICES_PLOCSUPERVISORHANDLER_H_ +#include #include #include "OBSWConfig.h" -#include "bsp_q7s/fs/SdCardManager.h" #include "devices/powerSwitcherList.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/timemanager/Countdown.h" #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" -#include "fsfw_hal/linux/uart/UartComIF.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" +#ifdef XIPHOS_Q7S +#include "bsp_q7s/fs/SdCardManager.h" +#endif + using supv::ExecutionReport; /** @@ -114,7 +117,7 @@ class PlocSupervisorHandler : public DeviceHandlerBase { */ DeviceCommandId_t nextReplyId = supv::NONE; - UartComIF* uartComIf = nullptr; + SerialComIF* uartComIf = nullptr; LinuxLibgpioIF* gpioComIF = nullptr; Gpio uartIsolatorSwitch; @@ -141,9 +144,9 @@ class PlocSupervisorHandler : public DeviceHandlerBase { /** This buffer is used to concatenate space packets received in two different read steps */ uint8_t spacePacketBuffer[supv::MAX_PACKET_SIZE]; -#ifndef TE0720_1CFA +#ifdef XIPHOS_Q7S SdCardManager* sdcMan = nullptr; -#endif /* BOARD_TE0720 == 0 */ +#endif // Path to supervisor specific files on SD card std::string supervisorFilePath = "ploc/supervisor"; diff --git a/linux/devices/ploc/PlocSupvUartMan.cpp b/linux/devices/ploc/PlocSupvUartMan.cpp index 3bb6e764..26da089b 100644 --- a/linux/devices/ploc/PlocSupvUartMan.cpp +++ b/linux/devices/ploc/PlocSupvUartMan.cpp @@ -16,9 +16,10 @@ #include "bsp_q7s/fs/SdCardManager.h" #endif +#include + #include "fsfw/tasks/TaskFactory.h" #include "fsfw/timemanager/Countdown.h" -#include "fsfw_hal/linux/uart/helper.h" #include "mission/utility/Filenaming.h" #include "mission/utility/ProgressPrinter.h" #include "mission/utility/Timestamp.h" diff --git a/linux/devices/ploc/PlocSupvUartMan.h b/linux/devices/ploc/PlocSupvUartMan.h index 30d5fe1f..d10a5373 100644 --- a/linux/devices/ploc/PlocSupvUartMan.h +++ b/linux/devices/ploc/PlocSupvUartMan.h @@ -2,6 +2,7 @@ #define BSP_Q7S_DEVICES_PLOCSUPVHELPER_H_ #include +#include #include #include @@ -13,7 +14,6 @@ #include "fsfw/osal/linux/BinarySemaphore.h" #include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" -#include "fsfw_hal/linux/uart/UartComIF.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" #ifdef XIPHOS_Q7S diff --git a/linux/devices/startracker/ArcsecDatalinkLayer.h b/linux/devices/startracker/ArcsecDatalinkLayer.h index ec8caed9..5681d3ca 100644 --- a/linux/devices/startracker/ArcsecDatalinkLayer.h +++ b/linux/devices/startracker/ArcsecDatalinkLayer.h @@ -1,6 +1,7 @@ #ifndef BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_ #define BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_ +#include "eive/resultClassIds.h" #include "fsfw/returnvalues/returnvalue.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" diff --git a/linux/devices/startracker/ArcsecJsonParamBase.h b/linux/devices/startracker/ArcsecJsonParamBase.h index 75b160b2..a7a4f421 100644 --- a/linux/devices/startracker/ArcsecJsonParamBase.h +++ b/linux/devices/startracker/ArcsecJsonParamBase.h @@ -5,6 +5,7 @@ #include #include +#include "eive/resultClassIds.h" #include "fsfw/returnvalues/returnvalue.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" diff --git a/linux/devices/startracker/StarTrackerHandler.cpp b/linux/devices/startracker/StarTrackerHandler.cpp index ff632c99..bede0a45 100644 --- a/linux/devices/startracker/StarTrackerHandler.cpp +++ b/linux/devices/startracker/StarTrackerHandler.cpp @@ -1591,7 +1591,7 @@ void StarTrackerHandler::preparePowerRequest() { void StarTrackerHandler::prepareSwitchToBootloaderCmd() { uint32_t length = 0; - struct RebootActionRequest rebootReq; + struct RebootActionRequest rebootReq {}; arc_pack_reboot_action_req(&rebootReq, commandBuffer, &length); dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = dataLinkLayer.getEncodedFrame(); diff --git a/linux/devices/startracker/StrHelper.cpp b/linux/devices/startracker/StrHelper.cpp index 1f6472bb..dcf56b59 100644 --- a/linux/devices/startracker/StrHelper.cpp +++ b/linux/devices/startracker/StrHelper.cpp @@ -85,7 +85,7 @@ ReturnValue_t StrHelper::performOperation(uint8_t operationCode) { } ReturnValue_t StrHelper::setComIF(DeviceCommunicationIF* communicationInterface_) { - uartComIF = dynamic_cast(communicationInterface_); + uartComIF = dynamic_cast(communicationInterface_); if (uartComIF == nullptr) { sif::warning << "StrHelper::initialize: Invalid uart com if" << std::endl; return returnvalue::FAILED; diff --git a/linux/devices/startracker/StrHelper.h b/linux/devices/startracker/StrHelper.h index a9c80d77..ab0498d9 100644 --- a/linux/devices/startracker/StrHelper.h +++ b/linux/devices/startracker/StrHelper.h @@ -10,12 +10,13 @@ #include "bsp_q7s/fs/SdCardManager.h" #endif +#include + #include "fsfw/devicehandlers/CookieIF.h" #include "fsfw/objectmanager/SystemObject.h" #include "fsfw/osal/linux/BinarySemaphore.h" #include "fsfw/returnvalues/returnvalue.h" #include "fsfw/tasks/ExecutableObjectIF.h" -#include "fsfw_hal/linux/uart/UartComIF.h" extern "C" { #include "thirdparty/arcsec_star_tracker/client/generated/actionreq.h" @@ -255,7 +256,7 @@ class StrHelper : public SystemObject, public ExecutableObjectIF { * UART communication object responsible for low level access of star tracker * Must be set by star tracker handler */ - UartComIF* uartComIF = nullptr; + SerialComIF* uartComIF = nullptr; // Communication cookie. Must be set by the star tracker handler CookieIF* comCookie = nullptr; diff --git a/linux/fsfwconfig/devices/addresses.cpp b/linux/fsfwconfig/devices/addresses.cpp deleted file mode 100644 index 580818e0..00000000 --- a/linux/fsfwconfig/devices/addresses.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "addresses.h"