From dc0c8c704c61acb8ab18187b5fb1f3a29e6d8539 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 20 Aug 2021 20:18:56 +0200 Subject: [PATCH] debugging GPS: uart is blocking! --- bsp_q7s/core/ObjectFactory.cpp | 8 ++++++-- .../pollingSequenceFactory.cpp | 20 +++++++++---------- mission/devices/GPSHyperionHandler.cpp | 15 +++++++++++++- mission/devices/GPSHyperionHandler.h | 3 ++- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index a22f219e..a5a69a35 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -477,8 +477,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI UartModes::CANONICAL, 9600, uart::HYPERION_GPS_REPLY_MAX_BUFFER); uartCookieGps1->setToFlushInput(true); uartCookieGps1->setReadCycles(6); - new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookieGps0, true); - new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, uartCookieGps1, true); + auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, + uartCookieGps0, true); + gpsHandler0->setStartUpImmediately(); + auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, + uartCookieGps1, true); + gpsHandler1->setStartUpImmediately(); } void ObjectFactory::createHeaterComponents() { diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 045a7af3..60d69e13 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -491,16 +491,16 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { // thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8, // DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.2, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.6, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.8, - DeviceHandlerIF::GET_READ); +// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0, +// DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.2, +// DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.4, +// DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.6, +// DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.8, +// DeviceHandlerIF::GET_READ); // thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0, // DeviceHandlerIF::PERFORM_OPERATION); diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index 34fdd47d..0abf10c2 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -121,7 +121,7 @@ ReturnValue_t GPSHyperionHandler::interpretDeviceReply(DeviceCommandId_t id, } uint32_t GPSHyperionHandler::getTransitionDelayMs(Mode_t from, Mode_t to) { - return 5000; + return 20000; } ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( @@ -150,3 +150,16 @@ void GPSHyperionHandler::fillCommandAndReplyMap() { void GPSHyperionHandler::modeChanged() { internalState = InternalStates::NONE; } + +void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId, + uint32_t parameter) { + if(positionTracker == 0) { + sif::debug << "state machine, mode " << parameter << std::endl; + } + else if(positionTracker == 1) { + sif::debug << "ALIVE" << std::endl; + } + if(positionTracker == 5) { + (void) positionTracker; + } +} diff --git a/mission/devices/GPSHyperionHandler.h b/mission/devices/GPSHyperionHandler.h index 49d8f416..ca7898ae 100644 --- a/mission/devices/GPSHyperionHandler.h +++ b/mission/devices/GPSHyperionHandler.h @@ -49,7 +49,8 @@ protected: uint32_t getTransitionDelayMs(Mode_t from, Mode_t to) override; ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) override; - + virtual void debugInterface(uint8_t positionTracker = 0, + object_id_t objectId = 0, uint32_t parameter = 0) override; private: lwgps_t gpsData = {}; GpsPrimaryDataset gpsSet;