eive-obsw/bsp_q7s/callbacks/gnssCallback.cpp

26 lines
681 B
C++
Raw Normal View History

2021-09-07 16:11:02 +02:00
#include "gnssCallback.h"
2022-01-17 13:48:55 +01:00
#include "devices/gpioIds.h"
2021-09-07 16:11:02 +02:00
#include "fsfw/tasks/TaskFactory.h"
2022-01-17 13:48:55 +01:00
ReturnValue_t gps::triggerGpioResetPin(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;
if (resetArgs->gnss1) {
gpioId = gpioIds::GNSS_1_NRESET;
2021-09-07 16:11:02 +02:00
2022-01-17 13:48:55 +01:00
} else {
gpioId = gpioIds::GNSS_0_NRESET;
}
resetArgs->gpioComIF->pullLow(gpioId);
TaskFactory::delayTask(resetArgs->waitPeriodMs);
resetArgs->gpioComIF->pullHigh(gpioId);
return HasReturnvaluesIF::RETURN_OK;
2021-09-07 16:11:02 +02:00
}