Skip to content

Commit

Permalink
inserted "GPS Cold Start" screen into control panel
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Feb 15, 2024
1 parent 44973b7 commit 647f939
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 16 deletions.
24 changes: 18 additions & 6 deletions Griduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
#include "cfg_audio_type.h" // config audio Morse/speech
#include "cfg_crossing.h" // config 4/6 digit crossing
#include "cfg_gps.h" // config GPS (alphabetical order)
#include "cfg_gps_reset.h" // config GPS reset to factory
#include "cfg_nmea.h" // config NMEA broadcasting
#include "cfg_reboot.h" // show firmware update option
#include "cfg_rotation.h" // config screen rotation
Expand Down Expand Up @@ -331,6 +332,7 @@ enum VIEW_INDEX {
CFG_AUDIO_TYPE, // audio output Morse/speech
CFG_CROSSING, // announce grid crossing 4/6 digit boundaries
CFG_GPS, // gps/simulator
CFG_GPS_RESET, // factory reset GPS
CFG_NMEA, // broadcast NMEA
CFG_REBOOT, // confirm reboot
CFG_ROTATION, // screen rotation
Expand Down Expand Up @@ -369,6 +371,7 @@ ViewBaro baroView(&tft, BARO_VIEW); // instantiate derived c
ViewCfgAudioType cfgAudioType(&tft, CFG_AUDIO_TYPE);
ViewCfgCrossing cfgCrossing(&tft, CFG_CROSSING);
ViewCfgGPS cfgGPS(&tft, CFG_GPS);
ViewCfgGpsReset cfgGpsReset(&tft, CFG_GPS_RESET);
ViewCfgNMEA cfgNMEA(&tft, CFG_NMEA);
ViewCfgReboot cfgReboot(&tft, CFG_REBOOT);
ViewCfgRotation cfgRotation(&tft, CFG_ROTATION);
Expand Down Expand Up @@ -396,6 +399,7 @@ void selectNewView(int cmd) {
&cfgAudioType, // [CFG_AUDIO_TYPE]
&cfgCrossing, // [CFG_CROSSING]
&cfgGPS, // [CFG_GPS]
&cfgGpsReset, // [CFG_GPS_RESET]
&cfgNMEA, // [CFG_NMEA]
&cfgReboot, // [CFG_REBOOT]
&cfgRotation, // [CFG_ROTATION]
Expand Down Expand Up @@ -441,7 +445,8 @@ void selectNewView(int cmd) {
case CFG_AUDIO_TYPE: nextView = CFG_CROSSING; break;
case CFG_CROSSING: nextView = CFG_GPS; break;
case CFG_GPS: nextView = CFG_NMEA; break;
case CFG_NMEA: nextView = CFG_UNITS; break;
case CFG_NMEA: nextView = CFG_GPS_RESET; break;
case CFG_GPS_RESET: nextView = CFG_UNITS; break;
case CFG_UNITS: nextView = CFG_ROTATION; break;
#if defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
case CFG_ROTATION: nextView = CFG_REBOOT; break;
Expand Down Expand Up @@ -680,12 +685,19 @@ void setup() {
GPS.begin(9600); // 9600 NMEA is the default baud rate for Adafruit MTK GPS's
delay(50); // is delay really needed?

//Serial.print("Set GPS baud rate to 57600: ");
//Serial.println(PMTK_SET_BAUD_57600);
//GPS.sendCommand(PMTK_SET_BAUD_57600);
//delay(50);
//GPS.begin(57600);
Serial.print("Set GPS baud rate to 57600: ");
Serial.println(PMTK_SET_BAUD_57600);
GPS.sendCommand(PMTK_SET_BAUD_57600);
delay(50);
GPS.begin(57600);
delay(50);

/****************** DANGER ****************/
// one-time usage
// Full Cold Restart: reset the receiver to the factory status
//GPS.sendCommand("$PMTK104*37\r\n");
//delay(50);
/****************** DANGER ****************/

// init Quectel L86 chip to improve USA satellite acquisition
GPS.sendCommand("$PMTK353,1,0,0,0,0*2A"); // search American GPS satellites only (not Russian GLONASS satellites)
Expand Down
2 changes: 1 addition & 1 deletion cfg_audio_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ void ViewCfgAudioType::startScreen() {
txtSettings5[ii].print();
}

showProgressBar(2, 7); // draw marker for advancing through settings
showProgressBar(2, 8); // draw marker for advancing through settings
showScreenBorder(); // optionally outline visible area
showScreenCenterline(); // optionally draw alignment bar

Expand Down
2 changes: 1 addition & 1 deletion cfg_crossing.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void ViewCfgCrossing::startScreen() {
txtSettings4[ii].print();
}

showProgressBar(3, 7); // draw marker for advancing through settings
showProgressBar(3, 8); // draw marker for advancing through settings
showScreenBorder(); // optionally outline visible area
showScreenCenterline(); // optionally draw alignment bar

Expand Down
3 changes: 1 addition & 2 deletions cfg_gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class ViewCfgGPS : public View {
{"%d crumbs", col1, yRow2, cLABEL}, // [TRAILCOUNT]
{"Route", col1, yRow3, cVALUE}, // [GPSTYPE]
{PROGRAM_VERDATE, -1, yRow9, cLABEL, ALIGNCENTER}, // [COMPILED]
//{"4 of 6", xPanel, 20, cFAINT}, // [PANEL]
};
// clang-format on

Expand Down Expand Up @@ -205,7 +204,7 @@ void ViewCfgGPS::startScreen() {
tft->drawCircle(xCenter, yCenter, 7, cVALUE);
}

showProgressBar(4, 7); // draw marker for advancing through settings
showProgressBar(4, 8); // draw marker for advancing through settings
updateScreen(); // fill in values immediately, don't wait for the main loop to eventually get around to it

showScreenCenterline(); // optionally draw alignment bar
Expand Down
7 changes: 4 additions & 3 deletions cfg_nmea.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ class ViewCfgNMEA : public View {
// color scheme: see constants.h

// vertical placement of text rows
const int space = 30;
const int yRow1 = 80;
const int yRow2 = yRow1 + 24;
const int yRow3 = yRow2 + 24;
const int yRow4 = yRow3 + 50;
const int yRow5 = yRow4 + 24;
const int yRow9 = gScreenHeight - 10; // "v1.14, Feb 12 2024"
const int yRow9 = gScreenHeight - 10; // "v1.14, Feb 15 2024"

const int yButton1 = 62;
const int yButton2 = yButton1 + 54;
Expand All @@ -82,7 +83,7 @@ class ViewCfgNMEA : public View {
#define nTextNMEA 6
TextField txtStatic[nTextNMEA] = {
// text x, y color
{"NMEA Sentences", -1, 20, cHIGHLIGHT, ALIGNCENTER},
{"GPS NMEA Sentences", -1, 20, cHIGHLIGHT, ALIGNCENTER},
{"Report GPS ", col1, yRow1, cVALUE},
{"positions", col1, yRow2, cVALUE},
{"NMEA sentences are available", -1, yRow4, cFAINT, ALIGNCENTER},
Expand Down Expand Up @@ -182,7 +183,7 @@ void ViewCfgNMEA::startScreen() {
tft->drawCircle(xCenter, yCenter, 7, cVALUE);
}

showProgressBar(5, 7); // draw marker for advancing through settings
showProgressBar(5, 8); // draw marker for advancing through settings
updateScreen(); // update UI immediately, don't wait for laggy mainline loop
} // end startScreen()

Expand Down
2 changes: 1 addition & 1 deletion cfg_reboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void ViewCfgReboot::startScreen() {
tft->print(item.text);
}

showProgressBar(7, 7); // draw marker for advancing through settings
showProgressBar(7, 8); // draw marker for advancing through settings
updateScreen(); // update UI immediately, don't wait for the main loop to eventually get around to it
} // end startScreen()

Expand Down
2 changes: 1 addition & 1 deletion cfg_rotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void ViewCfgRotation::startScreen() {
tft->drawCircle(xCenter, yCenter, 7, cVALUE);
}

showProgressBar(6, 7); // draw marker for advancing through settings
showProgressBar(8, 8); // draw marker for advancing through settings
updateScreen(); // update UI immediately, don't wait for laggy mainline loop
} // end startScreen()

Expand Down
2 changes: 1 addition & 1 deletion cfg_volume.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ void ViewVolume::startScreen() {
yy = volButtons[1].y + volButtons[1].h / 2;
tft->fillTriangle(xx - ww, yy - nn, xx + ww, yy - nn, xx, yy + ht - nn, cVALUE); // arrow DOWN

showProgressBar(1, 7); // draw marker for advancing through settings
showProgressBar(1, 8); // draw marker for advancing through settings
updateScreen(); // update UI immediately, don't wait for laggy mainline loop
} // end startScreen()

Expand Down

0 comments on commit 647f939

Please sign in to comment.