diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 1d3e0b31..5cd52c91 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -144,7 +144,7 @@ void ObjectFactory::produce(void* args){ #endif spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev, - L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); + ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); auto adisHandler = new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie); adisHandler->setStartUpImmediately(); @@ -158,7 +158,7 @@ void ObjectFactory::produce(void* args){ #endif spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev, - L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); + ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); adisHandler = new GyroADIS16507Handler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie); adisHandler->setStartUpImmediately(); diff --git a/fsfw b/fsfw index d3b83f3c..c51d2df4 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit d3b83f3cf9d702f76ddc5a00ac715dc3a9ef5343 +Subproject commit c51d2df43dca317175a9448e662f7f469e5f8725 diff --git a/linux/fsfwconfig/FSFWConfig.h.in b/linux/fsfwconfig/FSFWConfig.h.in index 7314b275..1b8251da 100644 --- a/linux/fsfwconfig/FSFWConfig.h.in +++ b/linux/fsfwconfig/FSFWConfig.h.in @@ -78,5 +78,6 @@ static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048; #define FSFW_HAL_L3GD20_GYRO_DEBUG 0 #define FSFW_HAL_RM3100_MGM_DEBUG 0 #define FSFW_HAL_LIS3MDL_MGM_DEBUG 0 +#define FSFW_HAL_ADIS16507_GYRO_DEBUG 0 #endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 611928f3..646b8633 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -454,28 +454,28 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { // thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.85, // DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.25, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.75, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.85, - DeviceHandlerIF::GET_READ); - -// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, +// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0, // DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.3, +// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.25, // DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6, +// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, // DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.75, +// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.75, // DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.85, +// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.85, // DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.3, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.75, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.85, + DeviceHandlerIF::GET_READ); + // thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, // DeviceHandlerIF::PERFORM_OPERATION); // thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.35, diff --git a/mission/devices/GyroADIS16507Handler.cpp b/mission/devices/GyroADIS16507Handler.cpp index 793aad66..02e69eaf 100644 --- a/mission/devices/GyroADIS16507Handler.cpp +++ b/mission/devices/GyroADIS16507Handler.cpp @@ -1,8 +1,7 @@ +#include "GyroADIS16507Handler.h" #include #include -#include "GyroADIS16507Handler.h" - #if OBSW_ADIS16507_LINUX_COM_IF == 1 #include "fsfw_hal/linux/utility.h" #include "fsfw_hal/linux/spi/SpiCookie.h" @@ -16,7 +15,7 @@ GyroADIS16507Handler::GyroADIS16507Handler(object_id_t objectId, object_id_t deviceCommunication, CookieIF * comCookie): DeviceHandlerBase(objectId, deviceCommunication, comCookie), primaryDataset(this), configDataset(this), breakCountdown() { -#if OBSW_DEBUG_ADIS16507 == 1 +#if FSFW_HAL_ADIS16507_GYRO_DEBUG == 1 debugDivider = new PeriodicOperationDivider(5); #endif @@ -285,7 +284,7 @@ ReturnValue_t GyroADIS16507Handler::handleSensorData(const uint8_t *packet) { primaryDataset.setValidity(true, true); } -#if OBSW_DEBUG_ADIS16507 == 1 +#if FSFW_HAL_ADIS16507_GYRO_DEBUG == 1 if(debugDivider->checkAndIncrement()) { sif::info << "GyroADIS16507Handler: Angular velocities in deg / s" << std::endl; sif::info << "X: " << primaryDataset.angVelocX.value << std::endl; diff --git a/mission/devices/GyroADIS16507Handler.h b/mission/devices/GyroADIS16507Handler.h index 41be5734..467e0906 100644 --- a/mission/devices/GyroADIS16507Handler.h +++ b/mission/devices/GyroADIS16507Handler.h @@ -1,11 +1,13 @@ #ifndef MISSION_DEVICES_GYROADIS16507HANDLER_H_ #define MISSION_DEVICES_GYROADIS16507HANDLER_H_ -#include #include "OBSWConfig.h" -#include "fsfw/devicehandlers/DeviceHandlerBase.h" +#include "FSFWConfig.h" #include "devicedefinitions/GyroADIS16507Definitions.h" +#include "fsfw/globalfunctions/PeriodicOperationDivider.h" +#include "fsfw/devicehandlers/DeviceHandlerBase.h" + #if OBSW_ADIS16507_LINUX_COM_IF == 1 class SpiComIF; class SpiCookie; @@ -69,7 +71,7 @@ private: const uint8_t *sendData, size_t sendLen, void* args); #endif -#if OBSW_DEBUG_ADIS16507 == 1 +#if FSFW_HAL_ADIS16507_GYRO_DEBUG == 1 PeriodicOperationDivider* debugDivider; #endif Countdown breakCountdown; diff --git a/mission/devices/devicedefinitions/GyroADIS16507Definitions.h b/mission/devices/devicedefinitions/GyroADIS16507Definitions.h index a7970b81..b83c984d 100644 --- a/mission/devices/devicedefinitions/GyroADIS16507Definitions.h +++ b/mission/devices/devicedefinitions/GyroADIS16507Definitions.h @@ -1,6 +1,7 @@ #ifndef MISSION_DEVICES_DEVICEDEFINITIONS_GYROADIS16507DEFINITIONS_H_ #define MISSION_DEVICES_DEVICEDEFINITIONS_GYROADIS16507DEFINITIONS_H_ +#include "fsfw/devicehandlers/DeviceHandlerIF.h" #include "fsfw/datapoollocal/StaticLocalDataSet.h" #include