diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 58b9a7f9..a7b05e3d 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -68,13 +68,7 @@ void ObjectFactory::produce(void* args) { {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1}, {objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD}, }}; - const char* tmpI2cDev = q7s::I2C_PS_EIVE; - if (core::FW_VERSION_MAJOR == 4) { - tmpI2cDev = q7s::I2C_PL_EIVE; - } else if(core::FW_VERSION_MAJOR >= 5) { - tmpI2cDev = q7s::I2C_Q7_EIVE; - } - createTmpComponents(tmpDevsToAdd, tmpI2cDev); + createTmpComponents(tmpDevsToAdd); dummy::Tmp1075Cfg tmpCfg{}; tmpCfg.addTcsBrd0 = true; tmpCfg.addTcsBrd1 = true; diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 5e2cdb59..e43e3551 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -77,11 +77,8 @@ void ObjectFactory::produce(void* args) { // {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1}, {objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD}, }}; - const char* tmpI2cDev = q7s::I2C_PS_EIVE; - if (core::FW_VERSION_MAJOR >= 4) { - tmpI2cDev = q7s::I2C_PL_EIVE; - } - createTmpComponents(tmpDevsToAdd, tmpI2cDev); + + createTmpComponents(tmpDevsToAdd); #endif createSolarArrayDeploymentComponents(*pwrSwitcher, *gpioComIF); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler); diff --git a/bsp_q7s/objectFactory.cpp b/bsp_q7s/objectFactory.cpp index a96051f2..c18a48a6 100644 --- a/bsp_q7s/objectFactory.cpp +++ b/bsp_q7s/objectFactory.cpp @@ -161,8 +161,14 @@ void Factory::setStaticFrameworkObjectIds() { void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } -void ObjectFactory::createTmpComponents(std::vector> tmpDevsToAdd, - const char* i2cDev) { +void ObjectFactory::createTmpComponents( + std::vector> tmpDevsToAdd) { + const char* tmpI2cDev = q7s::I2C_PS_EIVE; + if (core::FW_VERSION_MAJOR == 4) { + tmpI2cDev = q7s::I2C_PL_EIVE; + } else if (core::FW_VERSION_MAJOR >= 5) { + tmpI2cDev = q7s::I2C_Q7_EIVE; + } std::vector tmpDevCookies; for (size_t idx = 0; idx < tmpDevsToAdd.size(); idx++) { diff --git a/bsp_q7s/objectFactory.h b/bsp_q7s/objectFactory.h index 779ad204..491720ac 100644 --- a/bsp_q7s/objectFactory.h +++ b/bsp_q7s/objectFactory.h @@ -58,8 +58,7 @@ void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher bool enableHkSets); void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler); -void createTmpComponents(std::vector> tmpDevsToAdd, - const char* i2cDev); +void createTmpComponents(std::vector> tmpDevsToAdd); void createRadSensorChipSelect(LinuxLibgpioIF* gpioIF); ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler); void createAcsBoardGpios(GpioCookie& cookie);