Skip to content

Commit 5e16e4b

Browse files
committed
Set Measurement, Nav, and GSV during module config
This allows the AP Config of measurement rates to correct set GSV.
1 parent 5564427 commit 5e16e4b

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

Firmware/RTK_Surveyor/Rover.ino

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,12 @@ bool configureUbloxModuleRover()
8080

8181
//The last thing we do is set output rate.
8282
response = true; //Reset
83-
if (i2cGNSS.getMeasurementRate() != settings.measurementRate)
84-
{
85-
response &= i2cGNSS.setMeasurementRate(settings.measurementRate);
86-
}
87-
if (i2cGNSS.getNavigationRate() != settings.navigationRate)
83+
84+
if (i2cGNSS.getMeasurementRate() != settings.measurementRate || i2cGNSS.getNavigationRate() != settings.navigationRate)
8885
{
89-
response &= i2cGNSS.setNavigationRate(settings.navigationRate);
86+
float secondsBetweenSolutions = (settings.measurementRate * settings.navigationRate) / 1000.0;
87+
setMeasurementRates(secondsBetweenSolutions); //This will set settings.measurementRate, settings.navigationRate, and GSV message
9088
}
91-
if (response == false)
92-
Serial.println("Set Nav Rate failed");
9389

9490
response &= i2cGNSS.saveConfiguration(); //Save the current settings to flash and BBR
9591
if (response == false)

Firmware/RTK_Surveyor/menuGNSS.ino

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void menuGNSS()
108108
}
109109
else
110110
{
111-
setMeasurementRates(1.0 / rate); //Convert Hz to seconds. This will set settings.measurementRate and settings.navigationRate
111+
setMeasurementRates(1.0 / rate); //Convert Hz to seconds. This will set settings.measurementRate, settings.navigationRate, and GSV message
112112
//Settings recorded to NVM and file at main menu exit
113113
}
114114
}
@@ -122,7 +122,7 @@ void menuGNSS()
122122
}
123123
else
124124
{
125-
setMeasurementRates(rate); //This will set settings.measurementRate and settings.navigationRate
125+
setMeasurementRates(rate); //This will set settings.measurementRate, settings.navigationRate, and GSV message
126126
//Settings recorded to NVM and file at main menu exit
127127
}
128128
}
@@ -291,7 +291,7 @@ void menuConstellations()
291291
//measurementRate > 25 & <= 65535
292292
//navigationRate >= 1 && <= 127
293293
//We give preference to limiting a measurementRate to 30s or below due to reported problems with measRates above 30.
294-
void setMeasurementRates(float secondsBetweenSolutions)
294+
bool setMeasurementRates(float secondsBetweenSolutions)
295295
{
296296
uint16_t measRate = 0; //Calculate these locally and then attempt to apply them to ZED at completion
297297
uint16_t navRate = 0;
@@ -340,8 +340,11 @@ void setMeasurementRates(float secondsBetweenSolutions)
340340
}
341341
else
342342
{
343-
Serial.println("menuGNSS: Failed to set measurement and navigation rates");
343+
Serial.println("Failed to set measurement and navigation rates");
344+
return(false);
344345
}
346+
347+
return(true);
345348
}
346349

347350
//We need to know our overall measurement frequency for things like setting the GSV NMEA sentence rate.

Firmware/RTK_Surveyor/menuMessages.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ void setLoggingType()
678678
void setLogTestFrequencyMessages(int rate, int messages)
679679
{
680680
//Set measurement frequency
681-
setMeasurementRates(1.0 / rate); //Convert Hz to seconds. This will set settings.measurementRate and settings.navigationRate
681+
setMeasurementRates(1.0 / rate); //Convert Hz to seconds. This will set settings.measurementRate, settings.navigationRate, and GSV message
682682

683683
//Set messages
684684
setGNSSMessageRates(settings.ubxMessages, 0); //Turn off all messages

0 commit comments

Comments
 (0)