awful solution but works
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2022-10-20 16:09:18 +02:00
parent 29a34256a7
commit 75a4cd1b69
7 changed files with 47 additions and 15 deletions

View File

@ -27,6 +27,8 @@
#include "mission/devices/torquer.h"
static constexpr bool ACTUATION_WIRETAPPING = false;
ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t pwrSwitcher)
: DeviceHandlerBase(objectId, comIF, comCookie),
@ -46,7 +48,7 @@ ImtqHandler::ImtqHandler(object_id_t objectId, object_id_t comIF, CookieIF* comC
}
}
ImtqHandler::~ImtqHandler() {}
ImtqHandler::~ImtqHandler() = default;
void ImtqHandler::doStartUp() {
if (goToNormalMode) {
@ -182,7 +184,7 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
}
ReturnValue_t result;
// Commands override anything which was set in the software
if (commandBuffer != nullptr) {
if (commandData != nullptr) {
dipoleSet.setValidityBufferGeneration(false);
result =
dipoleSet.deSerialize(&commandData, &commandDataLen, SerializeIF::Endianness::NETWORK);
@ -194,6 +196,11 @@ ReturnValue_t ImtqHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
// Read set dipole values from local pool
PoolReadGuard pg(&dipoleSet);
}
if (ACTUATION_WIRETAPPING) {
sif::debug << "Actuating IMTQ with parameters x = " << dipoleSet.xDipole.value
<< ", y = " << dipoleSet.yDipole.value << ", z = " << dipoleSet.zDipole.value
<< ", duration = " << dipoleSet.currentTorqueDurationMs.value << std::endl;
}
result = buildDipoleActuationCommand();
if (result != returnvalue::OK) {
return result;
@ -312,8 +319,17 @@ ReturnValue_t ImtqHandler::scanForReply(const uint8_t* start, size_t remainingSi
*foundLen = IMTQ::SIZE_SELF_TEST_RESULTS;
*foundId = IMTQ::GET_SELF_TEST_RESULT;
break;
case (IMTQ::CC::PAST_AVAILABLE_RESPONSE_BYTES): {
sif::warning << "IMTQHandler::scanForReply: Read 0xFF command byte, reading past available "
"bytes. Keep 1 ms delay"
" between I2C send and read"
<< std::endl;
result = IGNORE_REPLY_DATA;
break;
}
default:
sif::debug << "IMTQHandler::scanForReply: Reply contains invalid command code" << std::endl;
sif::debug << "IMTQHandler::scanForReply: Reply with length " << remainingSize
<< "contains invalid command code " << static_cast<int>(*start) << std::endl;
result = IGNORE_REPLY_DATA;
break;
}
@ -2276,6 +2292,11 @@ void ImtqHandler::checkErrorByte(const uint8_t errorByte, const uint8_t step) {
}
}
void ImtqHandler::doSendRead() {
TaskFactory::delayTask(1);
DeviceHandlerBase::doSendRead();
}
std::string ImtqHandler::makeStepString(const uint8_t step) {
std::string stepString("");
switch (step) {