This commit is contained in:
2021-05-24 01:20:44 +02:00
committed by Robin Mueller
parent 3dff66fc56
commit fbac40e9cd
11 changed files with 103 additions and 46 deletions

View File

@ -6,6 +6,12 @@ GyroADIS16507Handler::GyroADIS16507Handler(object_id_t objectId,
}
void GyroADIS16507Handler::doStartUp() {
if(internalState == InternalState::STARTUP) {
if(commandExecuted) {
commandExecuted = false;
internalState = InternalState::IDLE;
}
}
}
void GyroADIS16507Handler::doShutDown() {
@ -39,3 +45,7 @@ ReturnValue_t GyroADIS16507Handler::interpretDeviceReply(DeviceCommandId_t id,
void GyroADIS16507Handler::setNormalDatapoolEntriesInvalid() {
}
uint32_t GyroADIS16507Handler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
return 5000;
}

View File

@ -2,6 +2,7 @@
#define MISSION_DEVICES_GYROADIS16507HANDLER_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include "devicedefinitions/GyroADIS16507Definitions.h"
class GyroADIS16507Handler: public DeviceHandlerBase {
public:
@ -20,8 +21,17 @@ public:
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id,
const uint8_t *packet) override;
void setNormalDatapoolEntriesInvalid() override;
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
private:
enum class InternalState {
STARTUP,
IDLE
};
InternalState internalState = InternalState::STARTUP;
bool commandExecuted = false;
};

View File

@ -1,8 +1,11 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_GYROADIS16507DEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_GYROADIS16507DEFINITIONS_H_
#include <cstddef>
namespace ADIS16507 {
static constexpr size_t MAXIMUM_REPLY_SIZE = 64;
}
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GYROADIS16507DEFINITIONS_H_ */