This commit is contained in:
parent
3ab6494c28
commit
dc6a2ffe56
@ -521,6 +521,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||||
adisHandler->setStartUpImmediately();
|
adisHandler->setStartUpImmediately();
|
||||||
|
#if FSFW_HAL_ADIS1650X_GYRO_DEBUG == 1
|
||||||
|
adisHandler->setToGoToNormalModeImmediately();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Gyro 1 Side A
|
// Gyro 1 Side A
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||||
@ -538,6 +542,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|||||||
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
|
adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF,
|
||||||
spiCookie, ADIS1650X::Type::ADIS16505);
|
spiCookie, ADIS1650X::Type::ADIS16505);
|
||||||
adisHandler->setStartUpImmediately();
|
adisHandler->setStartUpImmediately();
|
||||||
|
#if FSFW_HAL_ADIS1650X_GYRO_DEBUG == 1
|
||||||
|
adisHandler->setToGoToNormalModeImmediately();
|
||||||
|
#endif
|
||||||
// Gyro 3 Side B
|
// Gyro 3 Side B
|
||||||
spiCookie =
|
spiCookie =
|
||||||
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE,
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 933da2f655717b66c1056e764c47a2eee473a137
|
Subproject commit 9b77060295c9c32ebfc2e7cf6517eb2e66216191
|
@ -36,6 +36,7 @@ void GyroADIS1650XHandler::doStartUp() {
|
|||||||
// Initial 310 ms start up time after power-up
|
// Initial 310 ms start up time after power-up
|
||||||
if (internalState == InternalState::STARTUP) {
|
if (internalState == InternalState::STARTUP) {
|
||||||
if (not commandExecuted) {
|
if (not commandExecuted) {
|
||||||
|
warningSwitch = true;
|
||||||
breakCountdown.setTimeout(ADIS1650X::START_UP_TIME);
|
breakCountdown.setTimeout(ADIS1650X::START_UP_TIME);
|
||||||
commandExecuted = true;
|
commandExecuted = true;
|
||||||
}
|
}
|
||||||
@ -54,8 +55,11 @@ void GyroADIS1650XHandler::doStartUp() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (internalState == InternalState::IDLE) {
|
if (internalState == InternalState::IDLE) {
|
||||||
|
if(goToNormalMode) {
|
||||||
setMode(MODE_NORMAL);
|
setMode(MODE_NORMAL);
|
||||||
// setMode(MODE_ON);
|
} else {
|
||||||
|
setMode(MODE_ON);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +85,7 @@ ReturnValue_t GyroADIS1650XHandler::buildTransitionDeviceCommand(DeviceCommandId
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
/* Might be a configuration error. */
|
// Might be a configuration error
|
||||||
sif::debug << "GyroADIS16507Handler::buildTransitionDeviceCommand: "
|
sif::debug << "GyroADIS16507Handler::buildTransitionDeviceCommand: "
|
||||||
"Unknown internal state!"
|
"Unknown internal state!"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -207,8 +211,11 @@ ReturnValue_t GyroADIS1650XHandler::interpretDeviceReply(DeviceCommandId_t id,
|
|||||||
if (((adisType == ADIS1650X::Type::ADIS16507) and (readProdId != ADIS1650X::PROD_ID_16507)) or
|
if (((adisType == ADIS1650X::Type::ADIS16507) and (readProdId != ADIS1650X::PROD_ID_16507)) or
|
||||||
((adisType == ADIS1650X::Type::ADIS16505) and (readProdId != ADIS1650X::PROD_ID_16505))) {
|
((adisType == ADIS1650X::Type::ADIS16505) and (readProdId != ADIS1650X::PROD_ID_16505))) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
|
if(warningSwitch) {
|
||||||
sif::warning << "GyroADIS1650XHandler::interpretDeviceReply: Invalid product ID "
|
sif::warning << "GyroADIS1650XHandler::interpretDeviceReply: Invalid product ID "
|
||||||
<< readProdId << std::endl;
|
<< readProdId << std::endl;
|
||||||
|
}
|
||||||
|
warningSwitch = false;
|
||||||
#endif
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
@ -321,7 +328,7 @@ ReturnValue_t GyroADIS1650XHandler::handleSensorData(const uint8_t *packet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t GyroADIS1650XHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
uint32_t GyroADIS1650XHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||||
return 10000;
|
return 6000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GyroADIS1650XHandler::prepareWriteCommand(uint8_t startReg, uint8_t valueOne,
|
void GyroADIS1650XHandler::prepareWriteCommand(uint8_t startReg, uint8_t valueOne,
|
||||||
@ -479,4 +486,6 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GyroADIS1650XHandler::setToGoToNormalModeImmediately() { goToNormalMode = true; }
|
||||||
|
|
||||||
#endif /* OBSW_ADIS1650X_LINUX_COM_IF == 1 */
|
#endif /* OBSW_ADIS1650X_LINUX_COM_IF == 1 */
|
||||||
|
@ -23,6 +23,8 @@ class GyroADIS1650XHandler : public DeviceHandlerBase {
|
|||||||
GyroADIS1650XHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie,
|
GyroADIS1650XHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie,
|
||||||
ADIS1650X::Type type);
|
ADIS1650X::Type type);
|
||||||
|
|
||||||
|
void setToGoToNormalModeImmediately();
|
||||||
|
|
||||||
// DeviceHandlerBase abstract function implementation
|
// DeviceHandlerBase abstract function implementation
|
||||||
void doStartUp() override;
|
void doStartUp() override;
|
||||||
void doShutDown() override;
|
void doShutDown() override;
|
||||||
@ -43,6 +45,8 @@ class GyroADIS1650XHandler : public DeviceHandlerBase {
|
|||||||
ADIS1650X::Type adisType;
|
ADIS1650X::Type adisType;
|
||||||
AdisGyroPrimaryDataset primaryDataset;
|
AdisGyroPrimaryDataset primaryDataset;
|
||||||
AdisGyroConfigDataset configDataset;
|
AdisGyroConfigDataset configDataset;
|
||||||
|
bool goToNormalMode = false;
|
||||||
|
bool warningSwitch = true;
|
||||||
|
|
||||||
enum class InternalState { STARTUP, CONFIG, IDLE };
|
enum class InternalState { STARTUP, CONFIG, IDLE };
|
||||||
|
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 8417d34265555dbcfb92cb2f73e20dddbd8fb924
|
Subproject commit 6f24d6a83995ca7a895c17a77a00bceac4d7f141
|
Loading…
Reference in New Issue
Block a user