gyro handler finished
This commit is contained in:
@ -23,19 +23,19 @@ MGMHandlerLIS3MDL::~MGMHandlerLIS3MDL() {
|
||||
|
||||
void MGMHandlerLIS3MDL::doStartUp() {
|
||||
switch (internalState) {
|
||||
case STATE_NONE:
|
||||
internalState = STATE_FIRST_CONTACT;
|
||||
case(InternalState::STATE_NONE):
|
||||
internalState = InternalState::STATE_FIRST_CONTACT;
|
||||
break;
|
||||
|
||||
case STATE_FIRST_CONTACT:
|
||||
internalState = STATE_SETUP;
|
||||
case(InternalState::STATE_FIRST_CONTACT):
|
||||
internalState = InternalState::STATE_SETUP;
|
||||
break;
|
||||
|
||||
case STATE_SETUP:
|
||||
internalState = STATE_CHECK_REGISTERS;
|
||||
case(InternalState::STATE_SETUP):
|
||||
internalState = InternalState::STATE_CHECK_REGISTERS;
|
||||
break;
|
||||
|
||||
case STATE_CHECK_REGISTERS: {
|
||||
case(InternalState::STATE_CHECK_REGISTERS): {
|
||||
// Set up cached registers which will be used to configure the MGM.
|
||||
if(commandExecuted) {
|
||||
commandExecuted = false;
|
||||
@ -56,20 +56,27 @@ void MGMHandlerLIS3MDL::doShutDown() {
|
||||
ReturnValue_t MGMHandlerLIS3MDL::buildTransitionDeviceCommand(
|
||||
DeviceCommandId_t *id) {
|
||||
switch (internalState) {
|
||||
case STATE_FIRST_CONTACT:
|
||||
case(InternalState::STATE_NONE):
|
||||
case(InternalState::STATE_NORMAL): {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
case(InternalState::STATE_FIRST_CONTACT): {
|
||||
*id = MGMLIS3MDL::IDENTIFY_DEVICE;
|
||||
break;
|
||||
|
||||
case STATE_SETUP:
|
||||
}
|
||||
case(InternalState::STATE_SETUP): {
|
||||
*id = MGMLIS3MDL::SETUP_MGM;
|
||||
break;
|
||||
|
||||
case STATE_CHECK_REGISTERS:
|
||||
}
|
||||
case(InternalState::STATE_CHECK_REGISTERS): {
|
||||
*id = MGMLIS3MDL::READ_CONFIG_AND_DATA;
|
||||
break;
|
||||
|
||||
}
|
||||
default:
|
||||
break;
|
||||
// might be a configuration error.
|
||||
sif::debug << "GyroHandler::buildTransitionDeviceCommand: Unknown "
|
||||
<< "internal state!" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
return buildCommandFromCommand(*id, NULL, 0);
|
||||
}
|
||||
@ -412,7 +419,7 @@ uint32_t MGMHandlerLIS3MDL::getTransitionDelayMs(Mode_t from, Mode_t to) {
|
||||
}
|
||||
|
||||
void MGMHandlerLIS3MDL::modeChanged(void) {
|
||||
internalState = STATE_NONE;
|
||||
internalState = InternalState::STATE_NONE;
|
||||
}
|
||||
|
||||
ReturnValue_t MGMHandlerLIS3MDL::initializeLocalDataPool(
|
||||
|
Reference in New Issue
Block a user