Device Handler Updates #9

Merged
meierj merged 29 commits from mueller/tmtc-dh-update into develop 2020-12-28 11:09:08 +01:00
3 changed files with 33 additions and 5 deletions
Showing only changes of commit 2203b8ed53 - Show all commits

View File

@ -1,4 +1,4 @@
#include "GyroHandler.h"
#include <mission/devices/GyroL3GD20Handler.h>
GyroHandler::GyroHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF *comCookie):
@ -8,11 +8,20 @@ GyroHandler::GyroHandler(object_id_t objectId, object_id_t deviceCommunication,
GyroHandler::~GyroHandler() {}
void GyroHandler::doStartUp() {
if(internalState == InternalState::STATE_NONE) {
internalState = InternalState::STATE_CONFIGURE;
}
if(internalState == InternalState::STATE_CONFIGURE) {
if(commandExecuted) {
internalState = InternalState::STATE_NORMAL;
commandExecuted = false;
}
}
}
void GyroHandler::doShutDown() {
setMode(_MODE_POWER_DOWN);
}
ReturnValue_t GyroHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) {

View File

@ -1,5 +1,5 @@
#ifndef MISSION_DEVICES_GYROHANDLER_H_
#define MISSION_DEVICES_GYROHANDLER_H_
#ifndef MISSION_DEVICES_GYROL3GD20HANDLER_H_
#define MISSION_DEVICES_GYROL3GD20HANDLER_H_
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
@ -41,8 +41,16 @@ protected:
private:
enum InternalState {
STATE_NONE,
STATE_CONFIGURE,
STATE_NORMAL
};
InternalState internalState = InternalState::STATE_NONE;
bool commandExecuted = false;
};
#endif /* MISSION_DEVICES_GYROHANDLER_H_ */
#endif /* MISSION_DEVICES_GYROL3GD20HANDLER_H_ */

View File

@ -0,0 +1,11 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_GYROL3GD20DEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_GYROL3GD20DEFINITIONS_H_
namespace L3GD20H {
}
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GYROL3GD20DEFINITIONS_H_ */