This commit is contained in:
parent
0ae55e0783
commit
268cd33677
@ -162,7 +162,7 @@ void ObjectFactory::produce(void* args){
|
||||
uartCookie->setToFlushInput(true);
|
||||
uartCookie->setReadCycles(6);
|
||||
GPSHyperionHandler* gpsHandler = new GPSHyperionHandler(objects::GPS0_HANDLER,
|
||||
objects::UART_COM_IF, uartCookie);
|
||||
objects::UART_COM_IF, uartCookie, true);
|
||||
gpsHandler->setStartUpImmediately();
|
||||
#endif
|
||||
|
||||
|
@ -15,10 +15,7 @@
|
||||
#define RPI_TEST_ACS_BOARD 0
|
||||
#endif
|
||||
|
||||
#define RPI_ADD_UART_TEST 1
|
||||
#if RPI_ADD_UART_TEST == 1
|
||||
#define RPI_TEST_GPS_DEVICE 0
|
||||
#endif
|
||||
#define RPI_ADD_UART_TEST 0
|
||||
|
||||
/* Adapt these values accordingly */
|
||||
namespace gpio {
|
||||
|
@ -7,8 +7,9 @@
|
||||
#include "lwgps/lwgps.h"
|
||||
|
||||
GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
|
||||
CookieIF *comCookie):
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this) {
|
||||
CookieIF *comCookie, bool debugHyperionGps):
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this),
|
||||
debugHyperionGps(debugHyperionGps) {
|
||||
lwgps_init(&gpsData);
|
||||
}
|
||||
|
||||
@ -100,13 +101,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
|
||||
gpsSet.hours = gpsData.hours;
|
||||
gpsSet.minutes = gpsData.minutes;
|
||||
gpsSet.seconds = gpsData.seconds;
|
||||
#if FSFW_HAL_DEBUG_HYPERION_GPS == 1
|
||||
if(debugHyperionGps) {
|
||||
sif::info << "GPS Data" << std::endl;
|
||||
printf("Valid status: %d\n", gpsData.is_valid);
|
||||
printf("Latitude: %f degrees\n", gpsData.latitude);
|
||||
printf("Longitude: %f degrees\n", gpsData.longitude);
|
||||
printf("Altitude: %f meters\n", gpsData.altitude);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
*foundLen = len;
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "devicedefinitions/GPSDefinitions.h"
|
||||
#include "lwgps/lwgps.h"
|
||||
|
||||
#ifndef FSFW_HAL_DEBUG_HYPERION_GPS
|
||||
#define FSFW_HAL_DEBUG_HYPERION_GPS 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Device handler for the Hyperion HT-GPS200 device
|
||||
@ -18,7 +16,7 @@
|
||||
class GPSHyperionHandler: public DeviceHandlerBase {
|
||||
public:
|
||||
GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
|
||||
CookieIF* comCookie);
|
||||
CookieIF* comCookie, bool debugHyperionGps = false);
|
||||
virtual ~GPSHyperionHandler();
|
||||
|
||||
protected:
|
||||
@ -54,6 +52,7 @@ protected:
|
||||
private:
|
||||
lwgps_t gpsData = {};
|
||||
GpsPrimaryDataset gpsSet;
|
||||
bool debugHyperionGps = false;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_GPSHYPERIONHANDLER_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user