sensor handling moved to separate function

This commit is contained in:
Robin Müller 2021-05-24 20:59:19 +02:00 committed by Robin Mueller
parent 0fa32ef2ea
commit 853a22c55a
2 changed files with 36 additions and 30 deletions

View File

@ -116,6 +116,15 @@ ReturnValue_t GyroADIS16507Handler::interpretDeviceReply(DeviceCommandId_t id,
break; break;
} }
case(ADIS16507::READ_SENSOR_DATA): { case(ADIS16507::READ_SENSOR_DATA): {
return handleSensorData(packet);
}
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t GyroADIS16507Handler::handleSensorData(const uint8_t *packet) {
BurstModes burstMode = getBurstMode(); BurstModes burstMode = getBurstMode();
switch(burstMode) { switch(burstMode) {
case(BurstModes::BURST_16_BURST_SEL_1): case(BurstModes::BURST_16_BURST_SEL_1):
@ -139,16 +148,12 @@ ReturnValue_t GyroADIS16507Handler::interpretDeviceReply(DeviceCommandId_t id,
#endif #endif
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
break;
} }
case(BurstModes::BURST_32_BURST_SEL_0): { case(BurstModes::BURST_32_BURST_SEL_0): {
break;
} }
} }
}
}
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -61,6 +61,7 @@ private:
const uint8_t *sendData, size_t sendLen, void* args); const uint8_t *sendData, size_t sendLen, void* args);
#endif #endif
ReturnValue_t handleSensorData(const uint8_t* packet);
}; };