lol
This commit is contained in:
@@ -65,12 +65,19 @@ void MenuGPS::update() {
|
|||||||
|
|
||||||
void MenuGPS::printPage() const {
|
void MenuGPS::printPage() const {
|
||||||
UBX_NAV_PVT_data_t* gpsData = this->navigation->getUbxData();
|
UBX_NAV_PVT_data_t* gpsData = this->navigation->getUbxData();
|
||||||
uint8_t fixType = gpsData->fixType;
|
uint8_t fixType = 0;
|
||||||
|
if (gpsData)
|
||||||
|
fixType = gpsData->fixType;
|
||||||
|
|
||||||
switch (this->currentPage) {
|
switch (this->currentPage) {
|
||||||
case 0: {
|
case 0: {
|
||||||
uint8_t siv = gpsData->numSV;
|
uint8_t siv = 0;
|
||||||
uint32_t pDOP = gpsData->pDOP;
|
uint32_t pDOP = 0;
|
||||||
|
if (fixType) {
|
||||||
|
siv = gpsData->numSV;
|
||||||
|
pDOP = gpsData->pDOP;
|
||||||
|
}
|
||||||
|
|
||||||
if (this->lcd) {
|
if (this->lcd) {
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
lcd->setCursor(0, 0);
|
lcd->setCursor(0, 0);
|
||||||
@@ -93,8 +100,14 @@ void MenuGPS::printPage() const {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 1: {
|
case 1: {
|
||||||
int32_t lat = gpsData->lat;
|
int32_t lat = 0;
|
||||||
int32_t lng = gpsData->lon;
|
int32_t lng = 0;
|
||||||
|
|
||||||
|
if (fixType) {
|
||||||
|
lat = gpsData->lat;
|
||||||
|
lng = gpsData->lon;
|
||||||
|
}
|
||||||
|
|
||||||
if (this->lcd) {
|
if (this->lcd) {
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
lcd->setCursor(0, 0);
|
lcd->setCursor(0, 0);
|
||||||
@@ -117,7 +130,10 @@ void MenuGPS::printPage() const {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: {
|
case 2: {
|
||||||
uint32_t unixEpoch = gpsData->sec;
|
uint32_t unixEpoch = 0;
|
||||||
|
|
||||||
|
if (fixType)
|
||||||
|
unixEpoch = gpsData->sec;
|
||||||
|
|
||||||
if (this->lcd) {
|
if (this->lcd) {
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
@@ -155,7 +171,10 @@ void MenuGPS::printPage() const {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: {
|
case 4: {
|
||||||
uint32_t accuracy = gpsData->hAcc;
|
uint32_t accuracy = 0;
|
||||||
|
|
||||||
|
if (fixType)
|
||||||
|
accuracy = gpsData->hAcc;
|
||||||
|
|
||||||
if (this->lcd) {
|
if (this->lcd) {
|
||||||
lcd->clear();
|
lcd->clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user