EIVE upstream #29

Merged
muellerr merged 693 commits from use-eive-upstream into develop 2023-06-30 15:44:39 +02:00
8 changed files with 25 additions and 23 deletions
Showing only changes of commit 285d327b97 - Show all commits

View File

@ -63,7 +63,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
const uint8_t* dataPtr = nullptr; const uint8_t* dataPtr = nullptr;
size_t size = 0; size_t size = 0;
ReturnValue_t result; ReturnValue_t result;
if(dataAddress != store_address_t::invalid()) { if (dataAddress != store_address_t::invalid()) {
hasAdditionalData = true; hasAdditionalData = true;
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size); ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -74,7 +74,7 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
} }
} }
result = owner->executeAction(actionId, commandedBy, dataPtr, size); result = owner->executeAction(actionId, commandedBy, dataPtr, size);
if(hasAdditionalData) { if (hasAdditionalData) {
ipcStore->deleteData(dataAddress); ipcStore->deleteData(dataAddress);
} }
if (result == HasActionsIF::EXECUTION_FINISHED) { if (result == HasActionsIF::EXECUTION_FINISHED) {

View File

@ -720,7 +720,8 @@ ReturnValue_t LocalDataPoolManager::togglePeriodicGeneration(sid_t sid, bool ena
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t LocalDataPoolManager::changeCollectionInterval(sid_t sid, float newCollectionInterval) { ReturnValue_t LocalDataPoolManager::changeCollectionInterval(sid_t sid,
float newCollectionInterval) {
LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, sid); LocalPoolDataSetBase* dataSet = HasLocalDpIFManagerAttorney::getDataSetHandle(owner, sid);
if (dataSet == nullptr) { if (dataSet == nullptr) {
printWarningOrError(sif::OutputTypes::OUT_WARNING, "changeCollectionInterval", printWarningOrError(sif::OutputTypes::OUT_WARNING, "changeCollectionInterval",

View File

@ -7,7 +7,7 @@ DummyPowerSwitcher::DummyPowerSwitcher(object_id_t objectId, size_t numberOfSwit
switcherList(numberOfSwitches), switcherList(numberOfSwitches),
fuseList(numberOfFuses), fuseList(numberOfFuses),
switchDelayMs(switchDelayMs) { switchDelayMs(switchDelayMs) {
for(auto &switchState: switcherList) { for (auto &switchState : switcherList) {
switchState = PowerSwitchIF::SWITCH_UNKNOWN; switchState = PowerSwitchIF::SWITCH_UNKNOWN;
} }
} }

View File

@ -5,8 +5,18 @@
namespace spi { namespace spi {
static constexpr uint8_t CLASS_ID = CLASS_ID::HAL_SPI;
static constexpr ReturnValue_t OPENING_FILE_FAILED = returnvalue::makeCode(CLASS_ID, 0);
/* Full duplex (ioctl) transfer failure */
static constexpr ReturnValue_t FULL_DUPLEX_TRANSFER_FAILED = returnvalue::makeCode(CLASS_ID, 1);
/* Half duplex (read/write) transfer failure */
static constexpr ReturnValue_t HALF_DUPLEX_TRANSFER_FAILED = returnvalue::makeCode(CLASS_ID, 2);
static constexpr ReturnValue_t TIMEOUT = returnvalue::makeCode(CLASS_ID, 3);
static constexpr ReturnValue_t BUSY = returnvalue::makeCode(CLASS_ID, 4);
static constexpr ReturnValue_t GENERIC_ERROR = returnvalue::makeCode(CLASS_ID, 5);
enum SpiModes : uint8_t { MODE_0, MODE_1, MODE_2, MODE_3 }; enum SpiModes : uint8_t { MODE_0, MODE_1, MODE_2, MODE_3 };
} } // namespace spi
#endif /* FSFW_HAL_COMMON_SPI_SPICOMMON_H_ */ #endif /* FSFW_HAL_COMMON_SPI_SPICOMMON_H_ */

View File

@ -173,7 +173,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
int fileDescriptor = 0; int fileDescriptor = 0;
UnixFileGuard fileHelper(dev, fileDescriptor, O_RDWR, "SpiComIF::sendMessage"); UnixFileGuard fileHelper(dev, fileDescriptor, O_RDWR, "SpiComIF::sendMessage");
if (fileHelper.getOpenResult() != returnvalue::OK) { if (fileHelper.getOpenResult() != returnvalue::OK) {
return OPENING_FILE_FAILED; return spi::OPENING_FILE_FAILED;
} }
spi::SpiModes spiMode = spi::SpiModes::MODE_0; spi::SpiModes spiMode = spi::SpiModes::MODE_0;
uint32_t spiSpeed = 0; uint32_t spiSpeed = 0;
@ -234,7 +234,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
if (retval < 0) { if (retval < 0) {
spiCookie->setTransferSize(0); spiCookie->setTransferSize(0);
utility::handleIoctlError("SpiComIF::sendMessage: ioctl error."); utility::handleIoctlError("SpiComIF::sendMessage: ioctl error.");
result = FULL_DUPLEX_TRANSFER_FAILED; result = spi::FULL_DUPLEX_TRANSFER_FAILED;
} }
#if FSFW_HAL_SPI_WIRETAPPING == 1 #if FSFW_HAL_SPI_WIRETAPPING == 1
performSpiWiretapping(spiCookie); performSpiWiretapping(spiCookie);
@ -250,7 +250,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
sif::printWarning("SpiComIF::sendMessage: Half-Duplex write operation failed!\n"); sif::printWarning("SpiComIF::sendMessage: Half-Duplex write operation failed!\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_VERBOSE_LEVEL >= 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */
result = HALF_DUPLEX_TRANSFER_FAILED; result = spi::HALF_DUPLEX_TRANSFER_FAILED;
} }
} }
@ -287,7 +287,7 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) {
int fileDescriptor = 0; int fileDescriptor = 0;
UnixFileGuard fileHelper(dev, fileDescriptor, O_RDWR, "SpiComIF::requestReceiveMessage"); UnixFileGuard fileHelper(dev, fileDescriptor, O_RDWR, "SpiComIF::requestReceiveMessage");
if (fileHelper.getOpenResult() != returnvalue::OK) { if (fileHelper.getOpenResult() != returnvalue::OK) {
return OPENING_FILE_FAILED; return spi::OPENING_FILE_FAILED;
} }
uint8_t* rxBuf = nullptr; uint8_t* rxBuf = nullptr;
@ -327,7 +327,7 @@ ReturnValue_t SpiComIF::performHalfDuplexReception(SpiCookie* spiCookie) {
sif::printWarning("SpiComIF::sendMessage: Half-Duplex read operation failed!\n"); sif::printWarning("SpiComIF::sendMessage: Half-Duplex read operation failed!\n");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */ #endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_VERBOSE_LEVEL >= 1 */ #endif /* FSFW_VERBOSE_LEVEL >= 1 */
result = HALF_DUPLEX_TRANSFER_FAILED; result = spi::HALF_DUPLEX_TRANSFER_FAILED;
} }
if (gpioId != gpio::NO_GPIO and not csLockManual) { if (gpioId != gpio::NO_GPIO and not csLockManual) {

View File

@ -22,15 +22,6 @@ class SpiCookie;
*/ */
class SpiComIF : public DeviceCommunicationIF, public SystemObject { class SpiComIF : public DeviceCommunicationIF, public SystemObject {
public: public:
static constexpr uint8_t spiRetvalId = CLASS_ID::HAL_SPI;
static constexpr ReturnValue_t OPENING_FILE_FAILED = returnvalue::makeCode(spiRetvalId, 0);
/* Full duplex (ioctl) transfer failure */
static constexpr ReturnValue_t FULL_DUPLEX_TRANSFER_FAILED =
returnvalue::makeCode(spiRetvalId, 1);
/* Half duplex (read/write) transfer failure */
static constexpr ReturnValue_t HALF_DUPLEX_TRANSFER_FAILED =
returnvalue::makeCode(spiRetvalId, 2);
SpiComIF(object_id_t objectId, std::string devname, GpioIF& gpioComIF); SpiComIF(object_id_t objectId, std::string devname, GpioIF& gpioComIF);
ReturnValue_t initializeInterface(CookieIF* cookie) override; ReturnValue_t initializeInterface(CookieIF* cookie) override;

View File

@ -357,13 +357,13 @@ ReturnValue_t SpiComIF::halErrorHandler(HAL_StatusTypeDef status, spi::TransferM
sif::printWarning("SpiComIF::handle%sSendOperation: HAL error %d occured\n", modeString, status); sif::printWarning("SpiComIF::handle%sSendOperation: HAL error %d occured\n", modeString, status);
switch (status) { switch (status) {
case (HAL_BUSY): { case (HAL_BUSY): {
return spi::HAL_BUSY_RETVAL; return spi::BUSY;
} }
case (HAL_ERROR): { case (HAL_ERROR): {
return spi::HAL_ERROR_RETVAL; return spi::GENERIC_ERROR;
} }
case (HAL_TIMEOUT): { case (HAL_TIMEOUT): {
return spi::HAL_TIMEOUT_RETVAL; return spi::TIMEOUT;
} }
default: { default: {
return returnvalue::FAILED; return returnvalue::FAILED;