run afmt
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-05-23 11:25:58 +02:00
parent 3bdad61ac0
commit 99e27a5a63
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
9 changed files with 58 additions and 56 deletions

View File

@ -1,4 +1,5 @@
#include <fsfw/health/HealthTableIF.h>
#include "OBSWConfig.h"
#include "bsp_q7s/core/CoreController.h"
#include "bsp_q7s/core/ObjectFactory.h"

View File

@ -4,11 +4,11 @@
#include <iostream>
#include "OBSWConfig.h"
#include "q7sConfig.h"
#include "commonConfig.h"
#include "core/InitMission.h"
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/version.h"
#include "q7sConfig.h"
#include "watchdog/definitions.h"
static int OBSW_ALREADY_RUNNING = -2;

View File

@ -6,7 +6,8 @@ ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCoo
FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, ACU::MAX_CONFIGTABLE_ADDRESS,
ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE),
coreHk(this), auxHk(this) {}
coreHk(this),
auxHk(this) {}
ACUHandler::~ACUHandler() {}
@ -15,10 +16,7 @@ ReturnValue_t ACUHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
return buildCommandFromCommand(*id, NULL, 0);
}
void ACUHandler::fillCommandAndReplyMap() {
GomspaceDeviceHandler::fillCommandAndReplyMap();
this->insertInCommandMap(PRINT_CHANNEL_STATS);
}
void ACUHandler::fillCommandAndReplyMap() { GomspaceDeviceHandler::fillCommandAndReplyMap(); }
void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
parseHkTableReply(packet);
@ -33,8 +31,7 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack
float tempC = coreHk.temperatures[idx] * 0.1;
sif::info << "ACU: Temperature " << idx << ": " << tempC << " °C" << std::endl;
}
sif::info << "ACU: Ground Watchdog Timer Count: " << auxHk.wdtCntGnd.value
<< std::endl;
sif::info << "ACU: Ground Watchdog Timer Count: " << auxHk.wdtCntGnd.value << std::endl;
sif::info << "ACU: Ground watchdog timer, seconds left before reboot: "
<< auxHk.wdtGndLeft.value << std::endl;
#endif
@ -72,7 +69,6 @@ ReturnValue_t ACUHandler::parseHkTableReply(const uint8_t *packet) {
dataOffset += 4;
}
coreHk.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
coreHk.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
@ -176,19 +172,6 @@ ReturnValue_t ACUHandler::initializeLocalDataPool(localpool::DataPool &localData
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t ACUHandler::childCommandHook(DeviceCommandId_t cmd, const uint8_t *commandData,
size_t commandDataLen) {
switch (cmd) {
case PRINT_CHANNEL_STATS: {
printChannelStats();
return RETURN_OK;
}
default: {
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
}
}
}
void ACUHandler::printChannelStats() {
PoolReadGuard pg(&coreHk);
sif::info << "ACU Info: Current [mA], Voltage [mV]" << std::endl;
@ -200,3 +183,25 @@ void ACUHandler::printChannelStats() {
}
void ACUHandler::setDebugMode(bool enable) { this->debugMode = enable; }
ReturnValue_t ACUHandler::printStatus(DeviceCommandId_t cmd) {
ReturnValue_t result = RETURN_OK;
switch (cmd) {
case (GOMSPACE::PRINT_SWITCH_V_I): {
PoolReadGuard pg(&coreHk);
result = pg.getReadResult();
if (result != HasReturnvaluesIF::RETURN_OK) {
break;
}
printChannelStats();
break;
}
default: {
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
}
}
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Reading PDU1 HK table failed!" << std::endl;
}
return result;
}

View File

@ -29,16 +29,13 @@ class ACUHandler : public GomspaceDeviceHandler {
*/
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
virtual void fillCommandAndReplyMap() override;
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
virtual ReturnValue_t childCommandHook(DeviceCommandId_t cmd, const uint8_t* commandData,
size_t commandDataLen) override;
virtual void fillCommandAndReplyMap() override;
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
private:
static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51;
ACU::CoreHk coreHk;
ACU::AuxHk auxHk;
bool debugMode = false;

View File

@ -251,7 +251,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
return HasReturnvaluesIF::RETURN_OK;
}
default: {
return HasReturnvaluesIF::RETURN_FAILED;
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
}
}
sif::warning << "Reading P60 Dock HK table failed" << std::endl;

View File

@ -122,7 +122,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
break;
}
default: {
return HasReturnvaluesIF::RETURN_FAILED;
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
}
}
if (result != HasReturnvaluesIF::RETURN_OK) {

View File

@ -76,7 +76,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
break;
}
default: {
return HasReturnvaluesIF::RETURN_FAILED;
return DeviceHandlerIF::COMMAND_NOT_SUPPORTED;
}
}
if (result != HasReturnvaluesIF::RETURN_OK) {

View File

@ -38,7 +38,8 @@ static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND]
//!< [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console
//! [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console
//! For the ACU device, only print voltages and currents of the 6 ACU channels
static const DeviceCommandId_t PRINT_SWITCH_V_I = 32;
static const DeviceCommandId_t PRINT_LATCHUPS = 33;
@ -583,7 +584,6 @@ public:
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_MPPT_TIME, this);
lp_var_t<uint16_t> mpptPeriod =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_MPPT_PERIOD, this);
};
/**
* @brief This class defines a dataset for the hk table of the ACU.
@ -596,7 +596,6 @@ class AuxHk : public StaticLocalDataSet<12> {
AuxHk(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::ACU_AUX))) {}
lp_vec_t<uint8_t, 3> dacEnables =
lp_vec_t<uint8_t, 3>(sid.objectId, P60System::pool::ACU_DAC_ENABLES, this);

2
tmtc

@ -1 +1 @@
Subproject commit ff66dd5dd2bc2ee3150ce45160303bc79ed2599d
Subproject commit c01f1d01916160888cf745ee3db6a2c46d795408