started gyro handler, renamed

This commit is contained in:
Robin Müller 2020-12-22 13:41:01 +01:00 committed by Robin Mueller
parent 23ce7dc5c3
commit 6f3a1c845c
3 changed files with 33 additions and 5 deletions

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_ */