diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index febae2f3..48e91013 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -135,6 +135,7 @@ void initmission::initTasks() { } bool startTestPst = true; + static_cast(startTestPst); #if OBSW_ADD_TEST_PST == 1 FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask("ACS_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc); @@ -145,14 +146,14 @@ void initmission::initTasks() { } #endif /* RPI_TEST_ACS_BOARD == 1 */ + +#if OBSW_ADD_TEST_CODE == 1 PeriodicTaskIF* testTask = factory->createPeriodicTask( "TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); -#if OBSW_ADD_TEST_CODE == 1 result = testTask->addComponent(objects::TEST_TASK); if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK); } -#endif /* OBSW_ADD_TEST_CODE == 1 */ #if RPI_ADD_SPI_TEST == 1 result = testTask->addComponent(objects::SPI_TEST); if(result != HasReturnvaluesIF::RETURN_OK) { @@ -171,6 +172,7 @@ void initmission::initTasks() { initmission::printAddObjectError("UART_TEST", objects::UART_TEST); } #endif /* RPI_ADD_GPIO_TEST == 1 */ +#endif /* OBSW_ADD_TEST_CODE == 1 */ sif::info << "Starting tasks.." << std::endl; tmTcDistributor->startTask(); diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 19b0d9e4..5597242c 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -132,20 +132,20 @@ void ObjectFactory::produce(void* args){ spiDev = "/dev/spidev0.0"; spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - auto mgmLis3Handler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER, - objects::SPI_COM_IF, spiCookie); + auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, + objects::SPI_COM_IF, spiCookie, 0); mgmLis3Handler->setStartUpImmediately(); spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER, - objects::SPI_COM_IF, spiCookie); + auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, + objects::SPI_COM_IF, spiCookie, 0); mgmRm3100Handler->setStartUpImmediately(); spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, - spiCookie); + spiCookie, 0); gyroL3gHandler->setStartUpImmediately(); #endif /* RPI_TEST_ACS_BOARD == 1 */ diff --git a/linux/boardtest/SpiTestClass.h b/linux/boardtest/SpiTestClass.h index 7ccc2eb7..45a7cdd8 100644 --- a/linux/boardtest/SpiTestClass.h +++ b/linux/boardtest/SpiTestClass.h @@ -45,14 +45,15 @@ private: /* ACS board specific variables */ #ifdef RASPBERRY_PI - uint8_t mgm0Lis3mdlChipSelect = 2; - uint8_t mgm1Rm3100ChipSelect = 3; - uint8_t gyro0AdisChipSelect = 4; - uint8_t gyro1L3gd20ChipSelect = 5; - int8_t gyro2AdisChipSelect = 6; - uint8_t gyro3L3gd20ChipSelect = 16; - uint8_t mgm2Lis3mdlChipSelect = 17; - uint8_t mgm3Rm3100ChipSelect = 27; + uint8_t mgm0Lis3mdlChipSelect = gpio::MGM_0_BCM_PIN; + uint8_t mgm1Rm3100ChipSelect = gpio::MGM_1_BCM_PIN; + uint8_t mgm2Lis3mdlChipSelect = gpio::MGM_2_BCM_PIN; + uint8_t mgm3Rm3100ChipSelect = gpio::MGM_3_BCM_PIN; + + uint8_t gyro0AdisChipSelect = gpio::GYRO_0_BCM_PIN; + uint8_t gyro1L3gd20ChipSelect = gpio::GYRO_1_BCM_PIN; + uint8_t gyro2AdisChipSelect = gpio::GYRO_2_BCM_PIN; + uint8_t gyro3L3gd20ChipSelect = gpio::GYRO_3_BCM_PIN; #elif defined(XIPHOS_Q7S) uint8_t mgm0Lis3mdlChipSelect = q7s::GPIO_MGM_0_LIS3_CS; uint8_t mgm1Rm3100ChipSelect = q7s::GPIO_MGM_1_RM3100_CS;