Skip to content

Commit f554801

Browse files
committed
//Text
1 parent 6bfecd7 commit f554801

25 files changed

+344
-348
lines changed

Firmware/RTK_Surveyor/Base.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bool configureUbloxModuleBase()
1515

1616
theGNSS.checkUblox(); //Regularly poll to get latest data and any RTCM
1717

18-
theGNSS.setNMEAGPGGAcallbackPtr(nullptr); // Disable GPGGA call back that may have been set during Rover NTRIP Client mode
18+
theGNSS.setNMEAGPGGAcallbackPtr(nullptr); //Disable GPGGA call back that may have been set during Rover NTRIP Client mode
1919

2020
bool response = true;
2121

@@ -27,13 +27,13 @@ bool configureUbloxModuleBase()
2727
//Since we are at 1Hz, allow GSV NMEA to be reported at whatever the user has chosen
2828
response &= theGNSS.addCfgValset(settings.ubxMessages[8].msgConfigKey, settings.ubxMessages[8].msgRate); //Update rate on module
2929

30-
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_NMEA_ID_GGA_I2C, 0); // Disable NMEA message that may have been set during Rover NTRIP Client mode
30+
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_NMEA_ID_GGA_I2C, 0); //Disable NMEA message that may have been set during Rover NTRIP Client mode
3131

3232
//Survey mode is only available on ZED-F9P modules
3333
if (zedModuleType == PLATFORM_F9P)
3434
response &= theGNSS.addCfgValset(UBLOX_CFG_TMODE_MODE, 0); //Disable survey-in mode
3535

36-
response &= theGNSS.addCfgValset(UBLOX_CFG_NAVSPG_DYNMODEL, (dynModel)settings.dynamicModel); // Set dynamic model
36+
response &= theGNSS.addCfgValset(UBLOX_CFG_NAVSPG_DYNMODEL, (dynModel)settings.dynamicModel); //Set dynamic model
3737

3838
//RTCM is only available on ZED-F9P modules
3939
//
@@ -69,7 +69,7 @@ bool configureUbloxModuleBase()
6969
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1124_UART1, 1);
7070
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1230_UART1, 10);
7171
}
72-
else // SPI GNSS
72+
else //SPI GNSS
7373
{
7474
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1005_SPI, 1);
7575
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1074_SPI, 1);
@@ -78,20 +78,20 @@ bool configureUbloxModuleBase()
7878
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1124_SPI, 1);
7979
response &= theGNSS.addCfgValset(UBLOX_CFG_MSGOUT_RTCM_3X_TYPE1230_SPI, 10); //Enable message every 10 cycles - note: this may conflict with settings and setMessages?
8080

81-
// Enable logging of these messages so the RTCM will be stored automatically in the logging buffer.
82-
// This mimics the data arriving via UART1.
81+
//Enable logging of these messages so the RTCM will be stored automatically in the logging buffer.
82+
//This mimics the data arriving via UART1.
8383
uint32_t logRTCMMessages = theGNSS.getRTCMLoggingMask();
8484
logRTCMMessages |= ( SFE_UBLOX_FILTER_RTCM_TYPE1005 | SFE_UBLOX_FILTER_RTCM_TYPE1074 | SFE_UBLOX_FILTER_RTCM_TYPE1084
8585
| SFE_UBLOX_FILTER_RTCM_TYPE1094 | SFE_UBLOX_FILTER_RTCM_TYPE1124 | SFE_UBLOX_FILTER_RTCM_TYPE1230 );
8686
theGNSS.setRTCMLoggingMask(logRTCMMessages);
8787
log_d("setRTCMLoggingMask 0x%X", logRTCMMessages);
8888

89-
// Update settings, otherwise setMessages could disable these again...
89+
//Update settings, otherwise setMessages could disable these again...
9090
for (int x = 0; x < MAX_UBX_MSG; x++)
9191
{
92-
if (settings.ubxMessages[x].msgClass == UBX_RTCM_MSB) // RTCM messages
92+
if (settings.ubxMessages[x].msgClass == UBX_RTCM_MSB) //RTCM messages
9393
{
94-
if (settings.ubxMessages[x].filterMask & // This is quicker than checking the msgID
94+
if (settings.ubxMessages[x].filterMask & //This is quicker than checking the msgID
9595
( SFE_UBLOX_FILTER_RTCM_TYPE1005 | SFE_UBLOX_FILTER_RTCM_TYPE1074 | SFE_UBLOX_FILTER_RTCM_TYPE1084
9696
| SFE_UBLOX_FILTER_RTCM_TYPE1094 | SFE_UBLOX_FILTER_RTCM_TYPE1124))
9797
settings.ubxMessages[x].msgRate = 1;

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void identifyBoard()
2929
}
3030
else
3131
{
32-
productVariant = RTK_UNKNOWN; // Need to wait until the GNSS and Accel have been initialized
32+
productVariant = RTK_UNKNOWN; //Need to wait until the GNSS and Accel have been initialized
3333
}
3434
}
3535

@@ -79,8 +79,8 @@ void initializePowerPins()
7979
pin_Ethernet_Interrupt = 33;
8080
pin_setupButton = 0;
8181

82-
pin_radio_rx = 17; // Radio RX In = ESP TX Out
83-
pin_radio_tx = 16; // Radio TX Out = ESP RX In
82+
pin_radio_rx = 17; //Radio RX In = ESP TX Out
83+
pin_radio_tx = 16; //Radio TX Out = ESP RX In
8484

8585
pinMode(pin_Ethernet_CS, OUTPUT);
8686
digitalWrite(pin_Ethernet_CS, HIGH);
@@ -219,9 +219,9 @@ void beginBoard()
219219
#ifdef COMPILE_SD_MMC
220220
else if (productVariant == REFERENCE_STATION)
221221
{
222-
// No powerOnCheck
222+
//No powerOnCheck
223223

224-
settings.enablePrintBatteryMessages = false; // No pesky battery messages
224+
settings.enablePrintBatteryMessages = false; //No pesky battery messages
225225

226226
strncpy(platformFilePrefix, "SFE_Reference_Station", sizeof(platformFilePrefix) - 1);
227227
strncpy(platformPrefix, "Reference Station", sizeof(platformPrefix) - 1);
@@ -388,7 +388,7 @@ void beginSD()
388388

389389
//TODO: add Card Detect input and check hot insertion
390390

391-
// SDIO MMC
391+
//SDIO MMC
392392
if (SD_MMC.begin() == false)
393393
{
394394
int tries = 0;
@@ -451,10 +451,6 @@ void endSD(bool alreadyHaveSemaphore, bool releaseSemaphore)
451451
{
452452
if (USE_SPI_MICROSD)
453453
sd->end();
454-
#ifdef COMPILE_SD_MMC
455-
// else
456-
// SD_MMC.end(); // NO!! DO NOT!!
457-
#endif
458454
online.microSD = false;
459455
systemPrintln("microSD: Offline");
460456
}
@@ -518,7 +514,7 @@ void beginUART2()
518514
"UARTStart", //Just for humans
519515
2000, //Stack Size
520516
nullptr, //Task input parameter
521-
0, // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
517+
0, //Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
522518
&pinUART2TaskHandle, //Task handle
523519
0); //Core where task should run, 0=core, 1=Arduino
524520

@@ -531,15 +527,15 @@ void pinUART2Task( void *pvParameters )
531527
{
532528
//Note: ESP32 2.0.6 does some strange auto-bauding thing here which takes 20s to complete if there is no data for it to auto-baud.
533529
// That's fine for most RTK products, but causes the Ref Stn to stall for 20s. However, it doesn't stall with ESP32 2.0.2...
534-
// Note to my future self: uncomment these lines to prevent the stall if/when we upgrade to ESP32 ~2.0.6.
530+
// Uncomment these lines to prevent the stall if/when we upgrade to ESP32 ~2.0.6.
535531
//#if defined(ENABLE_DEVELOPER) && defined(REF_STN_GNSS_DEBUG)
536532
// if (productVariant == REFERENCE_STATION)
537533
//#else
538534
// if (USE_I2C_GNSS)
539535
//#endif
540536
{
541-
serialGNSS.setRxBufferSize(settings.uartReceiveBufferSize); // TODO: work out if we can reduce or skip this when using SPI GNSS
542-
serialGNSS.setTimeout(settings.serialTimeoutGNSS); // Requires serial traffic on the UART pins for detection
537+
serialGNSS.setRxBufferSize(settings.uartReceiveBufferSize); //TODO: work out if we can reduce or skip this when using SPI GNSS
538+
serialGNSS.setTimeout(settings.serialTimeoutGNSS); //Requires serial traffic on the UART pins for detection
543539
serialGNSS.begin(settings.dataPortBaud); //UART2 on pins 16/17 for SPP. The ZED-F9P will be configured to output NMEA over its UART1 at the same rate.
544540

545541
//Reduce threshold value above which RX FIFO full interrupt is generated
@@ -575,11 +571,11 @@ void beginGNSS()
575571
//If we're using SPI, then increase the logging buffer
576572
if (USE_SPI_GNSS)
577573
{
578-
SPI.begin(); // Begin SPI here - beginSD has not yet been called
574+
SPI.begin(); //Begin SPI here - beginSD has not yet been called
579575

580-
// setFileBufferSize must be called _before_ .begin
581-
// Use gnssHandlerBufferSize for now. TODO: work out if the SPI GNSS needs its own buffer size setting
582-
// Also used by Tasks.ino
576+
//setFileBufferSize must be called _before_ .begin
577+
//Use gnssHandlerBufferSize for now. TODO: work out if the SPI GNSS needs its own buffer size setting
578+
//Also used by Tasks.ino
583579
theGNSS.setFileBufferSize(settings.gnssHandlerBufferSize);
584580
}
585581

@@ -614,7 +610,7 @@ void beginGNSS()
614610
return;
615611
}
616612
}
617-
if (theGNSS.getFileBufferSize() != settings.gnssHandlerBufferSize) // Need to call getFileBufferSize after begin
613+
if (theGNSS.getFileBufferSize() != settings.gnssHandlerBufferSize) //Need to call getFileBufferSize after begin
618614
{
619615
log_d("GNSS offline - no RAM for file buffer");
620616
displayGNSSFail(1000);
@@ -630,19 +626,19 @@ void beginGNSS()
630626
theGNSS.autoSendCfgValsetAtSpaceRemaining(16);
631627

632628
//Check the firmware version of the ZED-F9P. Based on Example21_ModuleInfo.
633-
if (theGNSS.getModuleInfo(1100) == true) // Try to get the module info
629+
if (theGNSS.getModuleInfo(1100) == true) //Try to get the module info
634630
{
635-
// Reconstruct the firmware version
631+
//Reconstruct the firmware version
636632
snprintf(zedFirmwareVersion, sizeof(zedFirmwareVersion), "%s %d.%02d", theGNSS.getFirmwareType(), theGNSS.getFirmwareVersionHigh(), theGNSS.getFirmwareVersionLow());
637633

638-
// Construct the firmware version as uint8_t. Note: will fail above 2.55!
634+
//Construct the firmware version as uint8_t. Note: will fail above 2.55!
639635
zedFirmwareVersionInt = (theGNSS.getFirmwareVersionHigh() * 100) + theGNSS.getFirmwareVersionLow();
640636

641-
// Check this is known firmware
642-
// "1.20" - Mostly for F9R HPS 1.20, but also F9P HPG v1.20 Spartan future support
643-
// "1.21" - Future F9R HPS v1.21
644-
// "1.30" - ZED-F9P (HPG) released Dec, 2021. Also ZED-F9R (HPS) released Sept, 2022
645-
// "1.32" - ZED-F9P released May, 2022
637+
//Check this is known firmware
638+
//"1.20" - Mostly for F9R HPS 1.20, but also F9P HPG v1.20 Spartan future support
639+
//"1.21" - Future F9R HPS v1.21
640+
//"1.30" - ZED-F9P (HPG) released Dec, 2021. Also ZED-F9R (HPS) released Sept, 2022
641+
//"1.32" - ZED-F9P released May, 2022
646642

647643
const uint8_t knownFirmwareVersions[] = { 100, 112, 113, 120, 121, 130, 132 };
648644
bool knownFirmware = false;
@@ -680,8 +676,8 @@ void configureGNSS()
680676
{
681677
if (online.gnss == false) return;
682678

683-
theGNSS.setAutoPVTcallbackPtr(&storePVTdata); // Enable automatic NAV PVT messages with callback to storePVTdata
684-
theGNSS.setAutoHPPOSLLHcallbackPtr(&storeHPdata); // Enable automatic NAV HPPOSLLH messages with callback to storeHPdata
679+
theGNSS.setAutoPVTcallbackPtr(&storePVTdata); //Enable automatic NAV PVT messages with callback to storePVTdata
680+
theGNSS.setAutoHPPOSLLHcallbackPtr(&storeHPdata); //Enable automatic NAV HPPOSLLH messages with callback to storeHPdata
685681

686682
//Configuring the ZED can take more than 2000ms. We save configuration to
687683
//ZED so there is no need to update settings unless user has modified
@@ -752,7 +748,7 @@ void beginLEDs()
752748
//Configure the on board MAX17048 fuel gauge
753749
void beginFuelGauge()
754750
{
755-
// Set up the MAX17048 LiPo fuel gauge
751+
//Set up the MAX17048 LiPo fuel gauge
756752
if (lipo.begin() == false)
757753
{
758754
systemPrintln("Fuel gauge not detected.");
@@ -908,11 +904,11 @@ bool beginExternalTriggers()
908904
response &= theGNSS.addCfgValset(UBLOX_CFG_TP_PULSE_LENGTH_DEF, 1); //Define timepulse by length (not ratio)
909905
response &= theGNSS.addCfgValset(UBLOX_CFG_TP_POL_TP1, settings.externalPulsePolarity); //0 = falling, 1 = raising edge
910906

911-
// While the module is _locking_ to GNSS time, turn off pulse
907+
//While the module is _locking_ to GNSS time, turn off pulse
912908
response &= theGNSS.addCfgValset(UBLOX_CFG_TP_PERIOD_TP1, 1000000); //Set the period between pulses in us
913909
response &= theGNSS.addCfgValset(UBLOX_CFG_TP_LEN_TP1, 0); //Set the pulse length in us
914910

915-
// When the module is _locked_ to GNSS time, make it generate 1kHz
911+
//When the module is _locked_ to GNSS time, make it generate 1kHz
916912
response &= theGNSS.addCfgValset(UBLOX_CFG_TP_PERIOD_LOCK_TP1, settings.externalPulseTimeBetweenPulse_us); //Set the period between pulses is us
917913
response &= theGNSS.addCfgValset(UBLOX_CFG_TP_LEN_LOCK_TP1, settings.externalPulseLength_us); //Set the pulse length in us
918914
response &= theGNSS.sendCfgValset();
@@ -945,7 +941,7 @@ void beginIdleTasks()
945941
taskName, //Just for humans
946942
2000, //Stack Size
947943
nullptr, //Task input parameter
948-
0, // Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
944+
0, //Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest
949945
&idleTaskHandle[index], //Task handle
950946
index); //Core where task should run, 0=core, 1=Arduino
951947
}

Firmware/RTK_Surveyor/Bluetooth.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2121

2222
//----------------------------------------
23-
// Constants
23+
//Constants
2424
//----------------------------------------
2525

2626
//----------------------------------------
27-
// Locals - compiled out
27+
//Locals - compiled out
2828
//----------------------------------------
2929

3030
#ifdef COMPILE_BT
3131
BTSerialInterface *bluetoothSerial;
3232
static volatile byte bluetoothState = BT_OFF;
3333

3434
//----------------------------------------
35-
// Bluetooth Routines - compiled out
35+
//Bluetooth Routines - compiled out
3636
//----------------------------------------
3737

3838
//Call back for when BT connection event happens (connected/disconnect)
@@ -61,7 +61,7 @@ void bluetoothCallback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param) {
6161
#endif //COMPILE_BT
6262

6363
//----------------------------------------
64-
// Global Bluetooth Routines
64+
//Global Bluetooth Routines
6565
//----------------------------------------
6666

6767
//Return the Bluetooth state
@@ -155,7 +155,7 @@ void bluetoothStart()
155155

156156
snprintf(deviceName, sizeof(deviceName), "%s %s%02X%02X", platformPrefix, stateName, btMACAddress[4], btMACAddress[5]);
157157

158-
// Select Bluetooth setup
158+
//Select Bluetooth setup
159159
if (settings.bluetoothRadioType == BLUETOOTH_RADIO_OFF)
160160
return;
161161
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP)

Firmware/RTK_Surveyor/Display.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//----------------------------------------
2-
// Constants
2+
//Constants
33
//----------------------------------------
44

55
//A bitfield is used to flag which icon needs to be illuminated
@@ -60,7 +60,7 @@
6060
#define ICON_LOGGING (1<<6) // right, bottom
6161

6262
//----------------------------------------
63-
// Locals
63+
//Locals
6464
//----------------------------------------
6565

6666
static QwiicMicroOLED oled;
@@ -71,16 +71,16 @@ static uint32_t iconsRadio;
7171
unsigned long ssidDisplayTimer = 0;
7272
bool ssidDisplayFirstHalf = false;
7373

74-
// Fonts
74+
//Fonts
7575
#include <res/qw_fnt_5x7.h>
7676
#include <res/qw_fnt_8x16.h>
7777
#include <res/qw_fnt_largenum.h>
7878

79-
// Icons
79+
//Icons
8080
#include "icons.h"
8181

8282
//----------------------------------------
83-
// Routines
83+
//Routines
8484
//----------------------------------------
8585

8686
void beginDisplay()
@@ -478,7 +478,7 @@ void displaySplash()
478478
{
479479
//Display SparkFun Logo for at least 1/10 of a second
480480
unsigned long minSplashFor = 100;
481-
if (productVariant == REFERENCE_STATION) // Reference station starts up very quickly. Keep splash on for longer
481+
if (productVariant == REFERENCE_STATION) //Reference station starts up very quickly. Keep splash on for longer
482482
minSplashFor = 1000;
483483
while ((millis() - splashStart) < minSplashFor)
484484
delay(10);
@@ -547,7 +547,7 @@ void displayError(const char * errorMessage)
547547
{
548548
if (online.display == true)
549549
{
550-
oled.erase(); // Clear the display's internal buffer
550+
oled.erase(); //Clear the display's internal buffer
551551

552552
oled.setCursor(0, 0); //x, y
553553
oled.setFont(QW_FONT_5X7); //Set font to smallest
@@ -1588,7 +1588,7 @@ void displayRoverStart(uint16_t displayTime)
15881588
uint8_t yPos = oled.getHeight() / 2 - fontHeight;
15891589

15901590
printTextCenter("Rover", yPos, QW_FONT_8X16, 1, false); //text, y, font type, kerning, inverted
1591-
// printTextCenter("Started", yPos + fontHeight, QW_FONT_8X16, 1, false); //text, y, font type, kerning, inverted
1591+
//printTextCenter("Started", yPos + fontHeight, QW_FONT_8X16, 1, false); //text, y, font type, kerning, inverted
15921592

15931593
oled.display();
15941594

@@ -1844,7 +1844,7 @@ void displayFirmwareUpdateProgress(int percentComplete)
18441844
//Update the display if connected
18451845
if (online.display == true)
18461846
{
1847-
oled.erase(); // Clear the display's internal buffer
1847+
oled.erase(); //Clear the display's internal buffer
18481848

18491849
int yPos = 3;
18501850
int fontHeight = 8;

0 commit comments

Comments
 (0)