eive-obsw/bsp_q7s/callbacks/gnssCallback.cpp

24 lines
704 B
C++

#include "gnssCallback.h"
#include "devices/gpioIds.h"
#include "fsfw/action/HasActionsIF.h"
#include "fsfw/tasks/TaskFactory.h"
ReturnValue_t gps::triggerGpioResetPin(uint8_t gpsId, void* args) {
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
if (args == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if (resetArgs->gpioComIF == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
gpioId_t gpioId = gpioIds::GNSS_0_NRESET;
if (gpsId == 1) {
gpioId = gpioIds::GNSS_1_NRESET;
}
resetArgs->gpioComIF->pullLow(gpioId);
TaskFactory::delayTask(resetArgs->waitPeriodMs);
resetArgs->gpioComIF->pullHigh(gpioId);
return HasReturnvaluesIF::RETURN_OK;
}