PDEC Config Persistent #398
@ -40,6 +40,7 @@
|
||||
#include "linux/ipcore/PdecHandler.h"
|
||||
#include "linux/ipcore/Ptme.h"
|
||||
#include "linux/ipcore/PtmeConfig.h"
|
||||
#include "mission/config/configfile.h"
|
||||
#include "mission/csp/CspCookie.h"
|
||||
#include "mission/system/fdir/AcsBoardFdir.h"
|
||||
#include "mission/system/fdir/GomspacePowerFdir.h"
|
||||
@ -54,7 +55,6 @@
|
||||
#include "mission/system/tree/payloadModeTree.h"
|
||||
#include "mission/system/tree/tcsModeTree.h"
|
||||
#include "mission/utility/GlobalConfigHandler.h"
|
||||
#include "mission/config/configfile.h"
|
||||
#include "tmtc/pusIds.h"
|
||||
#if OBSW_TEST_LIBGPIOD == 1
|
||||
#include "linux/boardtest/LibgpiodTest.h"
|
||||
|
@ -1,42 +1,41 @@
|
||||
#include "LocalParameterHandler.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
||||
LocalParameterHandler::LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan)
|
||||
: NVMParameterBase(), sdRelativeName(sdRelativeName), sdcMan(sdcMan) {}
|
||||
|
||||
LocalParameterHandler::~LocalParameterHandler() {
|
||||
}
|
||||
LocalParameterHandler::~LocalParameterHandler() {}
|
||||
|
||||
ReturnValue_t LocalParameterHandler::initialize() {
|
||||
ReturnValue_t result = updateFullName();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = readJsonFile();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
ReturnValue_t result = updateFullName();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = readJsonFile();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t LocalParameterHandler::writeJsonFile() {
|
||||
ReturnValue_t result = updateFullName();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return NVMParameterBase::writeJsonFile();
|
||||
ReturnValue_t result = updateFullName();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return NVMParameterBase::writeJsonFile();
|
||||
}
|
||||
|
||||
ReturnValue_t LocalParameterHandler::updateFullName() {
|
||||
std::string mountPrefix;
|
||||
auto activeSd = sdcMan->getActiveSdCard();
|
||||
if (activeSd and sdcMan->isSdCardUsable(activeSd.value())) {
|
||||
mountPrefix = sdcMan->getCurrentMountPrefix();
|
||||
} else {
|
||||
return SD_NOT_READY;
|
||||
}
|
||||
std::string fullname = mountPrefix + "/" + sdRelativeName;
|
||||
NVMParameterBase::setFullName(fullname);
|
||||
return returnvalue::OK;
|
||||
std::string mountPrefix;
|
||||
auto activeSd = sdcMan->getActiveSdCard();
|
||||
if (activeSd and sdcMan->isSdCardUsable(activeSd.value())) {
|
||||
mountPrefix = sdcMan->getCurrentMountPrefix();
|
||||
} else {
|
||||
return SD_NOT_READY;
|
||||
}
|
||||
std::string fullname = mountPrefix + "/" + sdRelativeName;
|
||||
NVMParameterBase::setFullName(fullname);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef BSP_Q7S_MEMORY_LOCALPARAMETERHANDLER_H_
|
||||
#define BSP_Q7S_MEMORY_LOCALPARAMETERHANDLER_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <mission/memory/NVMParameterBase.h>
|
||||
#include <mission/memory/SdCardMountedIF.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @brief Class to handle persistent parameters
|
||||
*
|
||||
@ -13,17 +13,17 @@
|
||||
*/
|
||||
class LocalParameterHandler : public NVMParameterBase {
|
||||
public:
|
||||
static constexpr uint8_t INTERFACE_ID = CLASS_ID::LOCAL_PARAM_HANDLER;
|
||||
|
||||
static constexpr uint8_t INTERFACE_ID = CLASS_ID::LOCAL_PARAM_HANDLER;
|
||||
|
||||
static constexpr ReturnValue_t SD_NOT_READY = returnvalue::makeCode(INTERFACE_ID, 0);
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param sdRelativeName Absolute name of json file relative to mount
|
||||
* directory of SD card. E.g. conf/example.json
|
||||
* @param sdcMan Pointer to SD card manager
|
||||
*/
|
||||
static constexpr ReturnValue_t SD_NOT_READY = returnvalue::makeCode(INTERFACE_ID, 0);
|
||||
/**
|
||||
* @brief Constructor
|
||||
*
|
||||
* @param sdRelativeName Absolute name of json file relative to mount
|
||||
* directory of SD card.
|
||||
* E.g. conf/example.json
|
||||
* @param sdcMan Pointer to SD card manager
|
||||
*/
|
||||
LocalParameterHandler(std::string sdRelativeName, SdCardMountedIF* sdcMan);
|
||||
virtual ~LocalParameterHandler();
|
||||
|
||||
@ -46,7 +46,8 @@ class LocalParameterHandler : public NVMParameterBase {
|
||||
* @details The function will add the parameter only if it is not already
|
||||
* present in the json file
|
||||
*/
|
||||
template<typename T> ReturnValue_t addParameter(std::string key, T value);
|
||||
template <typename T>
|
||||
ReturnValue_t addParameter(std::string key, T value);
|
||||
|
||||
/**
|
||||
* @brief Function will update a parameter which already exists in the json
|
||||
@ -57,10 +58,10 @@ class LocalParameterHandler : public NVMParameterBase {
|
||||
*
|
||||
* @return OK if successful, otherwise error return value
|
||||
*/
|
||||
template<typename T> ReturnValue_t updateParameter(std::string key, T value);
|
||||
template <typename T>
|
||||
ReturnValue_t updateParameter(std::string key, T value);
|
||||
|
||||
private:
|
||||
|
||||
// Name relative to mount point of SD card where parameters will be stored
|
||||
std::string sdRelativeName;
|
||||
|
||||
@ -77,28 +78,30 @@ class LocalParameterHandler : public NVMParameterBase {
|
||||
ReturnValue_t updateFullName();
|
||||
};
|
||||
|
||||
template<typename T> inline ReturnValue_t LocalParameterHandler::addParameter(std::string key, T value) {
|
||||
ReturnValue_t result = insertValue(key, value);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = writeJsonFile();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
template <typename T>
|
||||
inline ReturnValue_t LocalParameterHandler::addParameter(std::string key, T value) {
|
||||
ReturnValue_t result = insertValue(key, value);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = writeJsonFile();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
template<typename T> inline ReturnValue_t LocalParameterHandler::updateParameter(std::string key, T value) {
|
||||
ReturnValue_t result = setValue(key, value);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = writeJsonFile();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
template <typename T>
|
||||
inline ReturnValue_t LocalParameterHandler::updateParameter(std::string key, T value) {
|
||||
ReturnValue_t result = setValue(key, value);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = writeJsonFile();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
#endif /* BSP_Q7S_MEMORY_LOCALPARAMETERHANDLER_H_ */
|
||||
|
@ -13,10 +13,10 @@
|
||||
namespace CLASS_ID {
|
||||
enum {
|
||||
CLASS_ID_START = COMMON_CLASS_ID_END,
|
||||
SD_CARD_MANAGER, // SDMA
|
||||
SCRATCH_BUFFER, // SCBU
|
||||
LOCAL_PARAM_HANDLER, // LPH
|
||||
CLASS_ID_END // [EXPORT] : [END]
|
||||
SD_CARD_MANAGER, // SDMA
|
||||
SCRATCH_BUFFER, // SCBU
|
||||
LOCAL_PARAM_HANDLER, // LPH
|
||||
CLASS_ID_END // [EXPORT] : [END]
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,8 @@
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "pdecconfigdefs.h"
|
||||
|
||||
PdecConfig::PdecConfig() : localParameterHandler("conf/pdecconfig.json", SdCardManager::instance()) {}
|
||||
PdecConfig::PdecConfig()
|
||||
: localParameterHandler("conf/pdecconfig.json", SdCardManager::instance()) {}
|
||||
|
||||
PdecConfig::~PdecConfig() {}
|
||||
|
||||
@ -19,28 +20,28 @@ ReturnValue_t PdecConfig::write() {
|
||||
}
|
||||
ReturnValue_t result = initializePersistentParameters();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
result = writeFrameHeaderFirstOctet();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
result = writeFrameHeaderSecondOctet();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
writeMapConfig();
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecConfig::initializePersistentParameters() {
|
||||
ReturnValue_t result = localParameterHandler.initialize();
|
||||
if (result == HasFileSystemIF::FILE_DOES_NOT_EXIST) {
|
||||
result = createPersistentConfig();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if (result == HasFileSystemIF::FILE_DOES_NOT_EXIST) {
|
||||
result = createPersistentConfig();
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -51,8 +52,8 @@ ReturnValue_t PdecConfig::createPersistentConfig() {
|
||||
sif::error << "PdecConfig::createPersistentConfig: Failed to set positive window" << std::endl;
|
||||
return result;
|
||||
}
|
||||
result = localParameterHandler.addParameter(
|
||||
pdecconfigdefs::paramkeys::NEGATIVE_WINDOW, pdecconfigdefs::defaultvalue::negativeWindow);
|
||||
result = localParameterHandler.addParameter(pdecconfigdefs::paramkeys::NEGATIVE_WINDOW,
|
||||
pdecconfigdefs::defaultvalue::negativeWindow);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "PdecConfig::createPersistentConfig: Failed to set negative window" << std::endl;
|
||||
return result;
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "bsp_q7s/memory/LocalParameterHandler.h"
|
||||
#include "bsp_q7s/fs/SdCardManager.h"
|
||||
#include "bsp_q7s/memory/LocalParameterHandler.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
#include "pdec.h"
|
||||
|
||||
@ -19,9 +19,9 @@
|
||||
*/
|
||||
class PdecConfig {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
PdecConfig();
|
||||
virtual ~PdecConfig();
|
||||
|
||||
@ -49,7 +49,6 @@ class PdecConfig {
|
||||
ReturnValue_t getNegativeWindow(uint8_t& negativeWindow);
|
||||
|
||||
private:
|
||||
|
||||
// TC transfer frame configuration parameters
|
||||
static const uint8_t VERSION_ID = 0;
|
||||
// BD Frames
|
||||
@ -66,25 +65,25 @@ class PdecConfig {
|
||||
static const uint8_t CONFIG_WORDS_NUM = 2;
|
||||
|
||||
// 0x200 / 4 = 0x80
|
||||
static const uint32_t FRAME_HEADER_OFFSET = 0x80;
|
||||
static const uint32_t FRAME_HEADER_OFFSET = 0x80;
|
||||
|
||||
static const uint32_t MAP_ADDR_LUT_OFFSET = 0xA0;
|
||||
static const uint32_t MAP_CLK_FREQ_OFFSET = 0x90;
|
||||
// MAP clock frequency. Must be a value between 1 and 13 otherwise the TC segment will be
|
||||
// discarded
|
||||
static const uint8_t MAP_CLK_FREQ = 2;
|
||||
static const uint32_t MAP_ADDR_LUT_OFFSET = 0xA0;
|
||||
static const uint32_t MAP_CLK_FREQ_OFFSET = 0x90;
|
||||
// MAP clock frequency. Must be a value between 1 and 13 otherwise the TC segment will be
|
||||
// discarded
|
||||
static const uint8_t MAP_CLK_FREQ = 2;
|
||||
|
||||
static const uint8_t MAX_MAP_ADDR = 63;
|
||||
// Writing this to the map address in the look up table will invalidate a MAP ID.
|
||||
static const uint8_t NO_DESTINATION = 0;
|
||||
static const uint8_t VALID_POSITION = 6;
|
||||
static const uint8_t PARITY_POSITION = 7;
|
||||
static const uint8_t MAX_MAP_ADDR = 63;
|
||||
// Writing this to the map address in the look up table will invalidate a MAP ID.
|
||||
static const uint8_t NO_DESTINATION = 0;
|
||||
static const uint8_t VALID_POSITION = 6;
|
||||
static const uint8_t PARITY_POSITION = 7;
|
||||
|
||||
/**
|
||||
* TCs with map addresses (also know as Map IDs) assigned to this channel will be stored in
|
||||
* the PDEC memory.
|
||||
*/
|
||||
static const uint8_t PM_BUFFER = 7;
|
||||
/**
|
||||
* TCs with map addresses (also know as Map IDs) assigned to this channel will be stored in
|
||||
* the PDEC memory.
|
||||
*/
|
||||
static const uint8_t PM_BUFFER = 7;
|
||||
|
||||
uint32_t* memoryBaseAddress = nullptr;
|
||||
|
||||
@ -103,30 +102,30 @@ class PdecConfig {
|
||||
*/
|
||||
ReturnValue_t createPersistentConfig();
|
||||
|
||||
ReturnValue_t writeFrameHeaderFirstOctet();
|
||||
ReturnValue_t writeFrameHeaderSecondOctet();
|
||||
void writeMapConfig();
|
||||
ReturnValue_t writeFrameHeaderFirstOctet();
|
||||
ReturnValue_t writeFrameHeaderSecondOctet();
|
||||
void writeMapConfig();
|
||||
|
||||
/**
|
||||
* @brief This function calculates the entry for the configuration of the MAP ID routing.
|
||||
*
|
||||
* @param mapAddr The MAP ID to configure
|
||||
* @param moduleId The destination module where all TCs with the map id mapAddr will be routed
|
||||
* to.
|
||||
*
|
||||
* @details The PDEC has different modules where the TCs can be routed to. A lookup table is
|
||||
* used which links the MAP ID field to the destination module. The entry for this
|
||||
* lookup table is created by this function and must be stored in the configuration
|
||||
* memory region of the PDEC. The entry has a specific format
|
||||
*/
|
||||
uint8_t calcMapAddrEntry(uint8_t moduleId);
|
||||
/**
|
||||
* @brief This function calculates the entry for the configuration of the MAP ID routing.
|
||||
*
|
||||
* @param mapAddr The MAP ID to configure
|
||||
* @param moduleId The destination module where all TCs with the map id mapAddr will be routed
|
||||
* to.
|
||||
*
|
||||
* @details The PDEC has different modules where the TCs can be routed to. A lookup table is
|
||||
* used which links the MAP ID field to the destination module. The entry for this
|
||||
* lookup table is created by this function and must be stored in the configuration
|
||||
* memory region of the PDEC. The entry has a specific format
|
||||
*/
|
||||
uint8_t calcMapAddrEntry(uint8_t moduleId);
|
||||
|
||||
/**
|
||||
* @brief This functions calculates the odd parity of the bits in number.
|
||||
*
|
||||
* @param number The number from which to calculate the odd parity.
|
||||
*/
|
||||
uint8_t getOddParity(uint8_t number);
|
||||
/**
|
||||
* @brief This functions calculates the odd parity of the bits in number.
|
||||
*
|
||||
* @param number The number from which to calculate the odd parity.
|
||||
*/
|
||||
uint8_t getOddParity(uint8_t number);
|
||||
};
|
||||
|
||||
#endif /* LINUX_OBC_PDECCONFIG_H_ */
|
||||
|
@ -30,7 +30,7 @@ PdecHandler::PdecHandler(object_id_t objectId, object_id_t tcDestinationId,
|
||||
pdecReset(pdecReset),
|
||||
actionHelper(this, nullptr),
|
||||
uioNames(names),
|
||||
paramHelper(this) {
|
||||
paramHelper(this) {
|
||||
auto mqArgs = MqArgs(objectId, static_cast<void*>(this));
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
||||
QUEUE_SIZE, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
@ -91,33 +91,33 @@ ReturnValue_t PdecHandler::initialize() {
|
||||
}
|
||||
|
||||
ReturnValue_t PdecHandler::firstLoop() {
|
||||
ReturnValue_t result = pdecConfig.write();
|
||||
if (result != returnvalue::OK) {
|
||||
if (result == LocalParameterHandler::SD_NOT_READY) {
|
||||
return result;
|
||||
} else {
|
||||
sif::error << "PdecHandler::firstLoop: Failed to write PDEC config" << std::endl;
|
||||
}
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
ReturnValue_t result = pdecConfig.write();
|
||||
if (result != returnvalue::OK) {
|
||||
if (result == LocalParameterHandler::SD_NOT_READY) {
|
||||
return result;
|
||||
} else {
|
||||
sif::error << "PdecHandler::firstLoop: Failed to write PDEC config" << std::endl;
|
||||
}
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
result = releasePdec();
|
||||
if (result != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
result = releasePdec();
|
||||
if (result != returnvalue::OK) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
// This configuration must be done while the PDEC is not held in reset.
|
||||
if (OP_MODE == Modes::IRQ) {
|
||||
// Configure interrupt mask register to enable interrupts
|
||||
*(registerBaseAddress + PDEC_IMR_OFFSET) = pdecConfig.getImrReg();
|
||||
}
|
||||
result = resetFarStatFlag();
|
||||
if (result != returnvalue::OK) {
|
||||
// Requires reconfiguration and reinitialization of PDEC
|
||||
triggerEvent(INVALID_FAR);
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
// This configuration must be done while the PDEC is not held in reset.
|
||||
if (OP_MODE == Modes::IRQ) {
|
||||
// Configure interrupt mask register to enable interrupts
|
||||
*(registerBaseAddress + PDEC_IMR_OFFSET) = pdecConfig.getImrReg();
|
||||
}
|
||||
result = resetFarStatFlag();
|
||||
if (result != returnvalue::OK) {
|
||||
// Requires reconfiguration and reinitialization of PDEC
|
||||
triggerEvent(INVALID_FAR);
|
||||
return result;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecHandler::performOperation(uint8_t operationCode) {
|
||||
@ -134,7 +134,7 @@ ReturnValue_t PdecHandler::polledOperation() {
|
||||
|
||||
switch (state) {
|
||||
case State::INIT: {
|
||||
handleInitState();
|
||||
handleInitState();
|
||||
break;
|
||||
}
|
||||
case State::RUNNING: {
|
||||
@ -145,13 +145,13 @@ ReturnValue_t PdecHandler::polledOperation() {
|
||||
break;
|
||||
}
|
||||
case State::PDEC_RESET: {
|
||||
ReturnValue_t result = pdecToReset();
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(PDEC_RESET_FAILED);
|
||||
}
|
||||
state = State::INIT;
|
||||
break;
|
||||
}
|
||||
ReturnValue_t result = pdecToReset();
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(PDEC_RESET_FAILED);
|
||||
}
|
||||
state = State::INIT;
|
||||
break;
|
||||
}
|
||||
case State::WAIT_FOR_RECOVERY:
|
||||
break;
|
||||
default:
|
||||
@ -191,12 +191,12 @@ ReturnValue_t PdecHandler::irqOperation() {
|
||||
break;
|
||||
}
|
||||
case State::PDEC_RESET: {
|
||||
ReturnValue_t result = pdecToReset();
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(PDEC_RESET_FAILED);
|
||||
}
|
||||
state = State::INIT;
|
||||
break;
|
||||
ReturnValue_t result = pdecToReset();
|
||||
if (result != returnvalue::OK) {
|
||||
triggerEvent(PDEC_RESET_FAILED);
|
||||
}
|
||||
state = State::INIT;
|
||||
break;
|
||||
}
|
||||
case State::RUNNING: {
|
||||
checkAndHandleIrqs(fd, info);
|
||||
@ -218,24 +218,24 @@ ReturnValue_t PdecHandler::irqOperation() {
|
||||
}
|
||||
|
||||
void PdecHandler::handleInitState() {
|
||||
ReturnValue_t result = firstLoop();
|
||||
if (result != returnvalue::OK) {
|
||||
if (result == LocalParameterHandler::SD_NOT_READY) {
|
||||
TaskFactory::delayTask(400);
|
||||
if (initTries == MAX_INIT_TRIES) {
|
||||
sif::error << "PdecHandler::handleInitState: SD card never "
|
||||
"becomes ready"
|
||||
<< std::endl;
|
||||
state = State::WAIT_FOR_RECOVERY;
|
||||
return;
|
||||
} else {
|
||||
state = State::INIT;
|
||||
return;
|
||||
}
|
||||
}
|
||||
state = State::WAIT_FOR_RECOVERY;
|
||||
}
|
||||
state = State::RUNNING;
|
||||
ReturnValue_t result = firstLoop();
|
||||
if (result != returnvalue::OK) {
|
||||
if (result == LocalParameterHandler::SD_NOT_READY) {
|
||||
TaskFactory::delayTask(400);
|
||||
if (initTries == MAX_INIT_TRIES) {
|
||||
sif::error << "PdecHandler::handleInitState: SD card never "
|
||||
"becomes ready"
|
||||
<< std::endl;
|
||||
state = State::WAIT_FOR_RECOVERY;
|
||||
return;
|
||||
} else {
|
||||
state = State::INIT;
|
||||
return;
|
||||
}
|
||||
}
|
||||
state = State::WAIT_FOR_RECOVERY;
|
||||
}
|
||||
state = State::RUNNING;
|
||||
}
|
||||
|
||||
ReturnValue_t PdecHandler::checkAndHandleIrqs(int fd, uint32_t& info) {
|
||||
@ -422,7 +422,8 @@ ReturnValue_t PdecHandler::pdecToReset() {
|
||||
result = gpioComIF->pullLow(pdecReset);
|
||||
if (result != returnvalue::OK) {
|
||||
sif::error << "PdecHandler::pdecToReset: Failed to pull PDEC reset line"
|
||||
" to low" << std::endl;
|
||||
" to low"
|
||||
<< std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include "eive/definitions.h"
|
||||
#include "fsfw/action/ActionHelper.h"
|
||||
#include "fsfw/action/HasActionsIF.h"
|
||||
#include "fsfw/parameters/ReceivesParameterMessagesIF.h"
|
||||
#include "fsfw/parameters/ParameterHelper.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
#include "fsfw/parameters/ParameterHelper.h"
|
||||
#include "fsfw/parameters/ReceivesParameterMessagesIF.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
#include "fsfw/storagemanager/StorageManagerIF.h"
|
||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
||||
@ -103,8 +103,7 @@ class PdecHandler : public SystemObject,
|
||||
static constexpr Event WRITE_SYSCALL_ERROR_PDEC =
|
||||
event::makeEvent(SUBSYSTEM_ID, 9, severity::MEDIUM);
|
||||
//! [EXPORT] : [COMMENT] Failed to pull PDEC reset to low
|
||||
static constexpr Event PDEC_RESET_FAILED =
|
||||
event::makeEvent(SUBSYSTEM_ID, 10, severity::HIGH);
|
||||
static constexpr Event PDEC_RESET_FAILED = event::makeEvent(SUBSYSTEM_ID, 10, severity::HIGH);
|
||||
|
||||
private:
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::PDEC_HANDLER;
|
||||
@ -175,11 +174,11 @@ class PdecHandler : public SystemObject,
|
||||
static const uint32_t MAX_INIT_TRIES = 20;
|
||||
|
||||
class ParameterId {
|
||||
public:
|
||||
// ID of the parameter to update the positive window of AD frames
|
||||
static const uint8_t POSITIVE_WINDOW = 0;
|
||||
// ID of the parameter to update the negative window of AD frames
|
||||
static const uint8_t NEGATIVE_WINDOW = 1;
|
||||
public:
|
||||
// ID of the parameter to update the positive window of AD frames
|
||||
static const uint8_t POSITIVE_WINDOW = 0;
|
||||
// ID of the parameter to update the negative window of AD frames
|
||||
static const uint8_t NEGATIVE_WINDOW = 1;
|
||||
};
|
||||
|
||||
static constexpr uint32_t MAX_ALLOWED_IRQS_PER_WINDOW = 800;
|
||||
@ -377,7 +376,6 @@ class PdecHandler : public SystemObject,
|
||||
*/
|
||||
uint8_t calcMapAddrEntry(uint8_t moduleId);
|
||||
|
||||
|
||||
/**
|
||||
* brief Returns the 32-bit wide communication link control word (CLCW)
|
||||
*/
|
||||
|
@ -6,15 +6,15 @@
|
||||
namespace pdecconfigdefs {
|
||||
|
||||
namespace paramkeys {
|
||||
static const std::string POSITIVE_WINDOW = "positive_window";
|
||||
static const std::string NEGATIVE_WINDOW = "negattive_window";
|
||||
}
|
||||
static const std::string POSITIVE_WINDOW = "positive_window";
|
||||
static const std::string NEGATIVE_WINDOW = "negattive_window";
|
||||
} // namespace paramkeys
|
||||
|
||||
namespace defaultvalue {
|
||||
static const uint8_t positiveWindow = 10;
|
||||
static const uint8_t negativeWindow = 151;
|
||||
}
|
||||
static const uint8_t positiveWindow = 10;
|
||||
static const uint8_t negativeWindow = 151;
|
||||
} // namespace defaultvalue
|
||||
|
||||
}
|
||||
} // namespace pdecconfigdefs
|
||||
|
||||
#endif /* LINUX_IPCORE_PDECCONFIGDEFS_H_ */
|
||||
|
@ -2,8 +2,8 @@
|
||||
#define MISSION_CONFIG_CONFIGFILE_H_
|
||||
|
||||
namespace configfile {
|
||||
// Name of global config file relative to currently mounted SD card
|
||||
static const char sdrelative[] = "config/global_config.json";
|
||||
}
|
||||
// Name of global config file relative to currently mounted SD card
|
||||
static const char sdrelative[] = "config/global_config.json";
|
||||
} // namespace configfile
|
||||
|
||||
#endif /* MISSION_CONFIG_CONFIGFILE_H_ */
|
||||
|
@ -111,8 +111,7 @@ void Guidance::targetQuatPtgSingleAxis(timeval now, double posSatE[3], double ve
|
||||
if (sightAngleSun < critSightAngle) {
|
||||
strBlindAvoidFlag = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (sightAngleSun < blindEnd * exclAngle) {
|
||||
double normBlindRefRate = acsParameters.targetModeControllerParameters.blindRotRate;
|
||||
double blindRefRate[3] = {0, 0, 0};
|
||||
|
@ -1098,7 +1098,7 @@ void MultiplicativeKalmanFilter::reset(acsctrl::MekfData *mekfData) {
|
||||
}
|
||||
|
||||
void MultiplicativeKalmanFilter::updateDataSetWithoutData(acsctrl::MekfData *mekfData,
|
||||
MekfStatus mekfStatus) {
|
||||
MekfStatus mekfStatus) {
|
||||
{
|
||||
PoolReadGuard pg(mekfData);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
@ -1114,9 +1114,8 @@ void MultiplicativeKalmanFilter::updateDataSetWithoutData(acsctrl::MekfData *mek
|
||||
}
|
||||
}
|
||||
|
||||
void MultiplicativeKalmanFilter::updateDataSet(acsctrl::MekfData *mekfData,
|
||||
MekfStatus mekfStatus, double quat[4],
|
||||
double satRotRate[3]) {
|
||||
void MultiplicativeKalmanFilter::updateDataSet(acsctrl::MekfData *mekfData, MekfStatus mekfStatus,
|
||||
double quat[4], double satRotRate[3]) {
|
||||
{
|
||||
PoolReadGuard pg(mekfData);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
|
@ -69,7 +69,7 @@ inline ReturnValue_t NVMParameterBase::insertValue(std::string key, T value) {
|
||||
|
||||
template <typename T>
|
||||
inline ReturnValue_t NVMParameterBase::setValue(std::string key, T value) {
|
||||
json[key] = value;
|
||||
json[key] = value;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,8 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
|
||||
* @param maxNumberOfSequences
|
||||
* @param maxNumberOfTables
|
||||
* @param transmitterTimeout Maximum time the transmitter of the syrlinks
|
||||
* will be
|
||||
* enabled
|
||||
* will
|
||||
* be enabled
|
||||
*/
|
||||
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables,
|
||||
uint32_t transmitterTimeout);
|
||||
|
@ -11,12 +11,6 @@
|
||||
static constexpr double PARAM0_DEFAULT = 5.0;
|
||||
static constexpr int PARAM1_DEFAULT = 905;
|
||||
|
||||
enum ParamIds : uint8_t {
|
||||
PARAM0 = 0,
|
||||
PARAM1 = 1,
|
||||
PARAM2 = 2,
|
||||
PDEC_PW = 3,
|
||||
PDEC_NW = 4
|
||||
};
|
||||
enum ParamIds : uint8_t { PARAM0 = 0, PARAM1 = 1, PARAM2 = 2, PDEC_PW = 3, PDEC_NW = 4 };
|
||||
|
||||
#endif /* MISSION_UTILITY_GLOBALCONFIGFILEDEFINITIONS_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user