Skip to content

Commit 0ecf8ea

Browse files
committed
Add define for COMPILE_L_BAND, move L-Band related items into menuPP.ino
The following items were moved into menuPP.ino * L-Band variables * beginLBand routine
1 parent 4377368 commit 0ecf8ea

File tree

4 files changed

+264
-231
lines changed

4 files changed

+264
-231
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -710,89 +710,6 @@ bool beginExternalTriggers()
710710
return (response);
711711
}
712712

713-
//Check if NEO-D9S is connected. Configure if available.
714-
void beginLBand()
715-
{
716-
if (i2cLBand.begin(Wire, 0x43) == false) //Connect to the u-blox NEO-D9S using Wire port. The D9S default I2C address is 0x43 (not 0x42)
717-
{
718-
log_d("L-Band not detected");
719-
return;
720-
}
721-
722-
//Check the firmware version of the NEO-D9S. Based on Example21_ModuleInfo.
723-
if (i2cLBand.getModuleInfo(1100) == true) // Try to get the module info
724-
{
725-
//i2cLBand.minfo.extension[1] looks like 'FWVER=HPG 1.12'
726-
strcpy(neoFirmwareVersion, i2cLBand.minfo.extension[1]);
727-
728-
//Remove 'FWVER='. It's extraneous and = causes settings file parsing issues
729-
char *ptr = strstr(neoFirmwareVersion, "FWVER=");
730-
if (ptr != NULL)
731-
strcpy(neoFirmwareVersion, ptr + strlen("FWVER="));
732-
733-
printNEOInfo(); //Print module firmware version
734-
}
735-
736-
if (online.gnss == true)
737-
{
738-
i2cGNSS.checkUblox(); //Regularly poll to get latest data and any RTCM
739-
i2cGNSS.checkCallbacks(); //Process any callbacks: ie, eventTriggerReceived
740-
}
741-
742-
//If we have a fix, check which frequency to use
743-
if (fixType == 2 || fixType == 3 || fixType == 4 || fixType == 5) //2D, 3D, 3D+DR, or Time
744-
{
745-
if ( (longitude > -125 && longitude < -67) && (latitude > -90 && latitude < 90))
746-
{
747-
log_d("Setting L-Band to US");
748-
settings.LBandFreq = 1556290000; //We are in US band
749-
}
750-
else if ( (longitude > -25 && longitude < 70) && (latitude > -90 && latitude < 90))
751-
{
752-
log_d("Setting L-Band to EU");
753-
settings.LBandFreq = 1545260000; //We are in EU band
754-
}
755-
else
756-
{
757-
Serial.println("Unknown band area");
758-
settings.LBandFreq = 1556290000; //Default to US
759-
}
760-
recordSystemSettings();
761-
}
762-
else
763-
log_d("No fix available for L-Band frequency determination");
764-
765-
bool response = true;
766-
response &= i2cLBand.setVal32(UBLOX_CFG_PMP_CENTER_FREQUENCY, settings.LBandFreq); // Default 1539812500 Hz
767-
response &= i2cLBand.setVal16(UBLOX_CFG_PMP_SEARCH_WINDOW, 2200); // Default 2200 Hz
768-
response &= i2cLBand.setVal8(UBLOX_CFG_PMP_USE_SERVICE_ID, 0); // Default 1
769-
response &= i2cLBand.setVal16(UBLOX_CFG_PMP_SERVICE_ID, 21845); // Default 50821
770-
response &= i2cLBand.setVal16(UBLOX_CFG_PMP_DATA_RATE, 2400); // Default 2400 bps
771-
response &= i2cLBand.setVal8(UBLOX_CFG_PMP_USE_DESCRAMBLER, 1); // Default 1
772-
response &= i2cLBand.setVal16(UBLOX_CFG_PMP_DESCRAMBLER_INIT, 26969); // Default 23560
773-
response &= i2cLBand.setVal8(UBLOX_CFG_PMP_USE_PRESCRAMBLING, 0); // Default 0
774-
response &= i2cLBand.setVal64(UBLOX_CFG_PMP_UNIQUE_WORD, 16238547128276412563ull);
775-
response &= i2cLBand.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_PMP_I2C, 1); // Ensure UBX-RXM-PMP is enabled on the I2C port
776-
response &= i2cLBand.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_PMP_UART1, 1); // Output UBX-RXM-PMP on UART1
777-
response &= i2cLBand.setVal(UBLOX_CFG_UART2OUTPROT_UBX, 1); // Enable UBX output on UART2
778-
response &= i2cLBand.setVal(UBLOX_CFG_MSGOUT_UBX_RXM_PMP_UART2, 1); // Output UBX-RXM-PMP on UART2
779-
response &= i2cLBand.setVal32(UBLOX_CFG_UART1_BAUDRATE, 38400); // match baudrate with ZED default
780-
response &= i2cLBand.setVal32(UBLOX_CFG_UART2_BAUDRATE, 38400); // match baudrate with ZED default
781-
782-
if (response == false)
783-
Serial.println("L-Band failed to configure");
784-
785-
i2cLBand.softwareResetGNSSOnly(); // Do a restart
786-
787-
i2cLBand.setRXMPMPmessageCallbackPtr(&pushRXMPMP); // Call pushRXMPMP when new PMP data arrives. Push it to the GNSS
788-
789-
i2cGNSS.setRXMCORcallbackPtr(&checkRXMCOR); // Check if the PMP data is being decrypted successfully
790-
791-
log_d("L-Band online");
792-
793-
online.lband = true;
794-
}
795-
796713
void beginIdleTasks()
797714
{
798715
char taskName[32];

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const int FIRMWARE_VERSION_MINOR = 3;
2828
#define COMPILE_WIFI //Comment out to remove WiFi functionality
2929
#define COMPILE_BT //Comment out to remove Bluetooth functionality
3030
#define COMPILE_AP //Comment out to remove Access Point functionality
31+
#define COMPILE_L_BAND //Comment out to remove L-Band functionality
3132
//#define ENABLE_DEVELOPER //Uncomment this line to enable special developer modes (don't check power button at startup)
3233

3334
//Define the RTK board identifier:
@@ -321,18 +322,6 @@ unsigned long timeSinceLastIncomingSetting = 0;
321322

322323
//PointPerfect Corrections
323324
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
324-
SFE_UBLOX_GNSS_ADD i2cLBand; // NEO-D9S
325-
const char* pointPerfectKeyTopic = "/pp/ubx/0236/Lb";
326-
327-
//The PointPerfect token is provided at compile time via build flags
328-
#ifndef POINTPERFECT_TOKEN
329-
#define POINTPERFECT_TOKEN 0xAA, 0xBB, 0xCC, 0xDD, 0x00, 0x11, 0x22, 0x33, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03
330-
#endif
331-
332-
uint8_t pointPerfectTokenArray[16] = {POINTPERFECT_TOKEN}; //Token in HEX form
333-
334-
const char* pointPerfectAPI = "https://api.thingstream.io/ztp/pointperfect/credentials";
335-
void checkRXMCOR(UBX_RXM_COR_data_t *ubxDataStruct);
336325
float lBandEBNO = 0.0; //Used on system status menu
337326
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
338327

Firmware/RTK_Surveyor/States.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ void updateSystemState()
655655
}
656656
break;
657657

658+
#ifdef COMPILE_L_BAND
658659
case (STATE_KEYS_STARTED):
659660
{
660661
if (rtcWaitTime == 0) rtcWaitTime = millis();
@@ -898,6 +899,7 @@ void updateSystemState()
898899
changeState(settings.lastState); //Go to either rover or base
899900
}
900901
break;
902+
#endif //COMPILE_L_BAND
901903

902904
case (STATE_SHUTDOWN):
903905
{
@@ -1002,6 +1004,7 @@ void changeState(SystemState newState)
10021004
case (STATE_PROFILE):
10031005
Serial.print("State: Profile");
10041006
break;
1007+
#ifdef COMPILE_L_BAND
10051008
case (STATE_KEYS_STARTED):
10061009
Serial.print("State: Keys Started ");
10071010
break;
@@ -1038,6 +1041,7 @@ void changeState(SystemState newState)
10381041
case (STATE_KEYS_PROVISION_WIFI_TIMEOUT):
10391042
Serial.print("State: Keys Provision - WiFi Timeout");
10401043
break;
1044+
#endif //COMPILE_L_BAND
10411045

10421046
case (STATE_SHUTDOWN):
10431047
Serial.print("State: Shut Down");

0 commit comments

Comments
 (0)