@@ -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
753749void 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 }
0 commit comments