Merge remote-tracking branch 'origin/develop' into feature_com_pdec_fdir
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -17,8 +17,8 @@
|
||||
#include <mission/payload/ScexDeviceHandler.h>
|
||||
#include <mission/system/acs/SusAssembly.h>
|
||||
#include <mission/system/acs/SusFdir.h>
|
||||
#include <mission/system/fdir/RtdFdir.h>
|
||||
#include <mission/system/objects/TcsBoardAssembly.h>
|
||||
#include <mission/system/tcs/RtdFdir.h>
|
||||
#include <mission/system/tcs/TcsBoardAssembly.h>
|
||||
#include <mission/tcs/Max31865EiveHandler.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
@ -27,8 +27,8 @@
|
||||
#include "devices/gpioIds.h"
|
||||
#include "eive/definitions.h"
|
||||
#include "mission/system/acs/acsModeTree.h"
|
||||
#include "mission/system/tcs/tcsModeTree.h"
|
||||
#include "mission/system/tree/payloadModeTree.h"
|
||||
#include "mission/system/tree/tcsModeTree.h"
|
||||
#include "mission/tcs/defs.h"
|
||||
|
||||
void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||
|
@ -122,13 +122,14 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send
|
||||
} else {
|
||||
sif::warning << "AcsBoardPolling: Unknown ADIS type" << std::endl;
|
||||
}
|
||||
adis.replyResult = returnvalue::FAILED;
|
||||
adis.performStartup = true;
|
||||
} else if (req->mode == acs::SimpleSensorMode::OFF) {
|
||||
adis.performStartup = false;
|
||||
adis.ownReply.cfgWasSet = false;
|
||||
adis.ownReply.dataWasSet = false;
|
||||
adis.replyResult = returnvalue::OK;
|
||||
}
|
||||
adis.replyResult = returnvalue::FAILED;
|
||||
adis.mode = req->mode;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
@ -144,10 +145,11 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send
|
||||
if (req->mode == acs::SimpleSensorMode::NORMAL) {
|
||||
std::memcpy(gyro.sensorCfg, req->ctrlRegs, 5);
|
||||
gyro.performStartup = true;
|
||||
gyro.replyResult = returnvalue::FAILED;
|
||||
} else {
|
||||
gyro.ownReply.cfgWasSet = false;
|
||||
gyro.replyResult = returnvalue::OK;
|
||||
}
|
||||
gyro.replyResult = returnvalue::FAILED;
|
||||
gyro.mode = req->mode;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
@ -162,11 +164,12 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send
|
||||
if (req->mode != mgm.mode) {
|
||||
if (req->mode == acs::SimpleSensorMode::NORMAL) {
|
||||
mgm.performStartup = true;
|
||||
mgm.replyResult = returnvalue::FAILED;
|
||||
} else {
|
||||
mgm.ownReply.dataWasSet = false;
|
||||
mgm.replyResult = returnvalue::OK;
|
||||
mgm.ownReply.temperatureWasSet = false;
|
||||
}
|
||||
mgm.replyResult = returnvalue::FAILED;
|
||||
mgm.mode = req->mode;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
@ -181,10 +184,11 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send
|
||||
if (req->mode != mgm.mode) {
|
||||
if (req->mode == acs::SimpleSensorMode::NORMAL) {
|
||||
mgm.performStartup = true;
|
||||
mgm.replyResult = returnvalue::FAILED;
|
||||
} else {
|
||||
mgm.ownReply.dataWasRead = false;
|
||||
mgm.replyResult = returnvalue::OK;
|
||||
}
|
||||
mgm.replyResult = returnvalue::FAILED;
|
||||
mgm.mode = req->mode;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
|
@ -17,6 +17,10 @@
|
||||
#include "mission/utility/ProgressPrinter.h"
|
||||
#include "mission/utility/Timestamp.h"
|
||||
|
||||
extern "C" {
|
||||
#include <sagitta/client/actionreq.h>
|
||||
}
|
||||
|
||||
using namespace returnvalue;
|
||||
|
||||
StrComHandler::StrComHandler(object_id_t objectId) : SystemObject(objectId) {
|
||||
@ -305,6 +309,7 @@ ReturnValue_t StrComHandler::performImageUpload() {
|
||||
uint32_t imageSize = 0;
|
||||
struct UploadActionRequest uploadReq;
|
||||
uploadReq.position = 0;
|
||||
size_t writtenBytes = 0;
|
||||
#ifdef XIPHOS_Q7S
|
||||
if (not sdcMan->getActiveSdCard()) {
|
||||
return HasFileSystemIF::FILESYSTEM_INACTIVE;
|
||||
@ -327,7 +332,9 @@ ReturnValue_t StrComHandler::performImageUpload() {
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
ProgressPrinter progressPrinter("Image upload", imageSize);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
while ((uploadReq.position + 1) * SIZE_IMAGE_PART < imageSize) {
|
||||
size_t fullChunks = imageSize / SIZE_IMAGE_PART;
|
||||
size_t remainder = imageSize % SIZE_IMAGE_PART;
|
||||
for (size_t idx = 0; idx < fullChunks; idx++) {
|
||||
if (terminate) {
|
||||
return returnvalue::OK;
|
||||
}
|
||||
@ -346,6 +353,7 @@ ReturnValue_t StrComHandler::performImageUpload() {
|
||||
progressPrinter.print((uploadReq.position + 1) * SIZE_IMAGE_PART);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
uploadReq.position++;
|
||||
writtenBytes += SIZE_IMAGE_PART;
|
||||
|
||||
// This does a bit of delaying roughly every second
|
||||
if (uploadReq.position % 50 == 0) {
|
||||
@ -353,20 +361,20 @@ ReturnValue_t StrComHandler::performImageUpload() {
|
||||
TaskFactory::delayTask(2);
|
||||
}
|
||||
}
|
||||
std::memset(uploadReq.data, 0, sizeof(uploadReq.data));
|
||||
uint32_t remainder = imageSize - uploadReq.position * SIZE_IMAGE_PART;
|
||||
file.seekg(uploadReq.position * SIZE_IMAGE_PART, file.beg);
|
||||
file.read(reinterpret_cast<char*>(uploadReq.data), remainder);
|
||||
file.close();
|
||||
uploadReq.position++;
|
||||
arc_pack_upload_action_req(&uploadReq, cmdBuf.data(), &size);
|
||||
result = sendAndRead(size, uploadReq.position);
|
||||
if (result != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
result = checkActionReply(replyLen);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
if (remainder > 0) {
|
||||
std::memset(uploadReq.data, 0, sizeof(uploadReq.data));
|
||||
file.seekg(fullChunks * SIZE_IMAGE_PART, file.beg);
|
||||
file.read(reinterpret_cast<char*>(uploadReq.data), remainder);
|
||||
file.close();
|
||||
arc_pack_upload_action_req(&uploadReq, cmdBuf.data(), &size);
|
||||
result = sendAndRead(size, uploadReq.position);
|
||||
if (result != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
result = checkActionReply(replyLen);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print((uploadReq.position + 1) * SIZE_IMAGE_PART);
|
||||
|
@ -18,10 +18,6 @@
|
||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
||||
#include "fsfw_hal/linux/serial/SerialComIF.h"
|
||||
|
||||
extern "C" {
|
||||
#include <sagitta/client/arc_client.h>
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Helper class for the star tracker handler to accelerate large data transfers.
|
||||
*
|
||||
@ -176,7 +172,7 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
|
||||
static const uint32_t FLASH_REGION_SIZE = 0x20000;
|
||||
|
||||
struct ImageDownload {
|
||||
static const uint32_t LAST_POSITION = 4095;
|
||||
static const uint32_t LAST_POSITION = 4096;
|
||||
};
|
||||
|
||||
static const uint32_t MAX_POLLS = 10000;
|
||||
|
@ -69,11 +69,13 @@ ReturnValue_t SusPolling::sendMessage(CookieIF* cookie, const uint8_t* sendData,
|
||||
if (susDevs[susIdx].mode != susReq->mode) {
|
||||
if (susReq->mode == acs::SimpleSensorMode::NORMAL) {
|
||||
susDevs[susIdx].performStartup = true;
|
||||
susDevs[susIdx].replyResult = returnvalue::FAILED;
|
||||
} else {
|
||||
susDevs[susIdx].ownReply.cfgWasSet = false;
|
||||
susDevs[susIdx].ownReply.dataWasSet = false;
|
||||
// We are off now, but DHB wants a proper reply.
|
||||
susDevs[susIdx].replyResult = returnvalue::OK;
|
||||
}
|
||||
susDevs[susIdx].replyResult = returnvalue::FAILED;
|
||||
susDevs[susIdx].mode = susReq->mode;
|
||||
}
|
||||
if (state == InternalState::IDLE) {
|
||||
|
Reference in New Issue
Block a user