start creating rw ass in obj factory
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-05-10 18:39:23 +02:00
parent 1893e87f5f
commit db7dcc7e32
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -1,3 +1,4 @@
#include <mission/system/RwAssembly.h>
#include <mission/system/fdir/GomspacePowerFdir.h>
#include <mission/system/fdir/SyrlinksFdir.h>
@ -729,17 +730,16 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
{addresses::RW3, gpioIds::CS_RW3},
{addresses::RW4, gpioIds::CS_RW4}}};
std::array<SpiCookie*, 4> rwCookies = {};
std::array<std::pair<object_id_t, gpioId_t>, 4> rwDevParams = {{{objects::RW1, gpioIds::EN_RW1},
{objects::RW2, gpioIds::EN_RW2},
{objects::RW3, gpioIds::EN_RW3},
{objects::RW4, gpioIds::EN_RW4}}};
std::array<object_id_t, 4> rwIds = {objects::RW1, objects::RW2, objects::RW3, objects::RW4};
std::array<gpioId_t, 4> rwGpioIds = {gpioIds::EN_RW1, gpioIds::EN_RW2, gpioIds::EN_RW3,
gpioIds::EN_RW4};
std::array<RwHandler*, 4> rws = {};
for (uint8_t idx = 0; idx < rwCookies.size(); idx++) {
rwCookies[idx] = new SpiCookie(rwCookieParams[idx].first, rwCookieParams[idx].second,
q7s::SPI_RW_DEV, RwDefinitions::MAX_REPLY_SIZE, spi::RW_MODE,
spi::RW_SPEED, &rwSpiCallback::spiCallback, nullptr);
rws[idx] = new RwHandler(rwDevParams[idx].first, objects::SPI_COM_IF, rwCookies[idx], gpioComIF,
rwDevParams[idx].second);
rws[idx] =
new RwHandler(rwIds[idx], objects::SPI_COM_IF, rwCookies[idx], gpioComIF, rwGpioIds[idx]);
rwCookies[idx]->setCallbackArgs(rws[idx]);
#if OBSW_TEST_RW == 1
rws[idx]->setStartUpImmediately();
@ -748,6 +748,9 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
rws[idx]->setDebugMode(true);
#endif
}
RwHelper rwHelper(rwIds);
// auto* rwAss = new RwAssembly();
#endif /* OBSW_ADD_RW == 1 */
}