scex code #303

Merged
muellerr merged 125 commits from scex-additions into develop 2022-10-10 17:36:37 +02:00
5 changed files with 22 additions and 32 deletions
Showing only changes of commit 0341865e98 - Show all commits

2
fsfw

@ -1 +1 @@
Subproject commit d1630cdc4c3fc801934f1e394efa80e898f8031b Subproject commit 8195587604c5f14f04bf25b16a514cf3c771284b

View File

@ -52,6 +52,9 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
} }
size_t bytesRead = 0; size_t bytesRead = 0;
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
// Can be used to read frame, parity and overrun errors
// serial_icounter_struct icounter{};
// uart::readCountersAndErrors(serialPort, icounter);
while (result != DleParser::NO_PACKET_FOUND) { while (result != DleParser::NO_PACKET_FOUND) {
result = dleParser.parseRingBuf(bytesRead); result = dleParser.parseRingBuf(bytesRead);
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
@ -68,18 +71,6 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
dleParser.confirmBytesRead(bytesRead); dleParser.confirmBytesRead(bytesRead);
} }
} }
// TODO: Move this to some FSFW helper function
/*
serial_icounter_struct uartErrors{};
int ioctlres = ioctl(serialPort, TIOCGICOUNT, &uartErrors);
if (uartErrors.parity > 0) {
sif::warning << "Parity error. Current count: " << uartErrors.parity << std::endl;
}
if (uartErrors.overrun > 0) {
sif::warning << "Overrun error. Current count: " << uartErrors.overrun << std::endl;
}
*/
TaskFactory::delayTask(400); TaskFactory::delayTask(400);
} else if (bytesRead < 0) { } else if (bytesRead < 0) {
sif::warning << "ScexUartReader::performOperation: read call failed with error [" << errno sif::warning << "ScexUartReader::performOperation: read call failed with error [" << errno

View File

@ -5,10 +5,10 @@
#include <algorithm> #include <algorithm>
#include <ctime> #include <ctime>
#include <iostream>
#include <fstream>
#include <random>
#include <filesystem> #include <filesystem>
#include <fstream>
#include <iostream>
#include <random>
#include "fsfw/globalfunctions/CRC.h" #include "fsfw/globalfunctions/CRC.h"
#include "mission/devices/devicedefinitions/ScexDefinitions.h" #include "mission/devices/devicedefinitions/ScexDefinitions.h"
@ -348,11 +348,9 @@ void ScexDeviceHandler::modeChanged() {}
void ScexDeviceHandler::setPowerSwitcher(PowerSwitchIF& powerSwitcher, power::Switch_t switchId) { void ScexDeviceHandler::setPowerSwitcher(PowerSwitchIF& powerSwitcher, power::Switch_t switchId) {
DeviceHandlerBase::setPowerSwitcher(&powerSwitcher); DeviceHandlerBase::setPowerSwitcher(&powerSwitcher);
this->switchId = switchId; this->switchId = switchId;
} }
ReturnValue_t ScexDeviceHandler::initializeAfterTaskCreation() { ReturnValue_t ScexDeviceHandler::initializeAfterTaskCreation() {
auto mntPrefix = sdcMan.getCurrentMountPrefix(); auto mntPrefix = sdcMan.getCurrentMountPrefix();
std::filesystem::path fullFilePath = mntPrefix; std::filesystem::path fullFilePath = mntPrefix;
fullFilePath /= "scex"; fullFilePath /= "scex";

View File

@ -1,14 +1,15 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_SCEXDEFINITIONS_H_
#include "eive/objects.h"
#include "eive/eventSubsystemIds.h"
#include <fsfw/devicehandlers/DeviceHandlerIF.h> #include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/events/Event.h> #include <fsfw/events/Event.h>
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>
#include "eive/eventSubsystemIds.h"
#include "eive/objects.h"
// Definitions for the Solar Cell Experiment // Definitions for the Solar Cell Experiment
namespace scex { namespace scex {