continue SA DEPL impl
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2022-10-13 15:09:47 +02:00
parent 20b57906b7
commit db7f7bdae2
2 changed files with 94 additions and 62 deletions

View File

@ -2,6 +2,7 @@
#define MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
#include <unordered_map>
#include "devices/powerSwitcherList.h"
@ -13,12 +14,30 @@
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/power/PowerSwitchIF.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "fsfw/serialize/SerialLinkedListAdapter.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/timemanager/Countdown.h"
#include "fsfw_hal/common/gpio/GpioIF.h"
#include "mission/memory/SdCardMountedIF.h"
#include "returnvalues/classIds.h"
enum DeploymentChannels : uint8_t { SA_1 = 1, SA_2 = 2 };
class ManualDeploymentCommand : SerialLinkedListAdapter<SerializeIF> {
public:
ManualDeploymentCommand() = default;
void setLinks() {
setStart(&burnTime);
burnTime.setNext(&channel);
}
private:
SerializeElement<uint32_t> burnTime;
// Deployment channel SA1 or SA2
SerializeElement<uint8_t> channel;
};
/**
* @brief This class is used to control the solar array deployment.
*
@ -28,11 +47,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
public SystemObject,
public HasActionsIF {
public:
// Burn them for a custom amount limited by 120 secs
//! Manual deployment of the solar arrays. Burn time and channels are supplied with TC parameters
static constexpr DeviceCommandId_t DEPLOY_SOLAR_ARRAYS_MANUALLY = 0x05;
// Careful with these command, not automatic off handling!
static constexpr DeviceCommandId_t FORCE_DEPLY_ON = 0x06;
static constexpr DeviceCommandId_t FORCE_DEPLY_OFF = 0x07;
static constexpr uint32_t FIRST_BURN_START_TIME = config::SA_DEPL_BURN_TIME_SECS;
static constexpr uint32_t FIRST_BURN_END_TIME =
@ -95,6 +111,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
static const Event DEPLOYMENT_FAILED = MAKE_EVENT(2, severity::HIGH);
static const Event DEPL_SA1_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(3, severity::HIGH);
static const Event DEPL_SA2_GPIO_SWTICH_ON_FAILED = MAKE_EVENT(4, severity::HIGH);
static const Event DEPL_SA1_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(5, severity::HIGH);
static const Event DEPL_SA2_GPIO_SWTICH_OFF_FAILED = MAKE_EVENT(6, severity::HIGH);
enum AutonomousDeplState { INIT, FIRST_BURN, WAIT, SECOND_BURN, DONE };
enum StateMachine {
@ -178,8 +196,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
/**
* @brief This functions handles the switching of the solar array deployment transistors.
*/
ReturnValue_t deploymentTransistorsOn();
ReturnValue_t deploymentTransistorsOff();
ReturnValue_t deploymentTransistorsOn(DeploymentChannels channel);
ReturnValue_t deploymentTransistorsOff(DeploymentChannels channel);
};
#endif /* MISSION_DEVICES_SOLARARRAYDEPLOYMENT_H_ */