Skip to content

Commit 81089c1

Browse files
authored
Merge pull request #106 from sparkfun/release_candidate
Fix UART1 incorrect baud rate
2 parents 0a7e73b + 8c46241 commit 81089c1

File tree

11 files changed

+86
-46
lines changed

11 files changed

+86
-46
lines changed

.gitignore

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
1-
# Windows image file caches
2-
Thumbs.db
3-
ehthumbs.db
4-
5-
#Eagle Backup files
6-
*.s#?
7-
*.b#?
8-
*.l#?
9-
*.lck
10-
11-
# Folder config file
12-
Desktop.ini
13-
14-
# Recycle Bin used on file shares
15-
$RECYCLE.BIN/
16-
17-
# Windows Installer files
18-
*.cab
19-
*.msi
20-
*.msm
21-
*.msp
22-
23-
# =========================
24-
# Operating System Files
25-
# =========================
26-
27-
# OSX
28-
# =========================
29-
1+
tokens.h
2+
3+
# Windows image file caches
4+
Thumbs.db
5+
ehthumbs.db
6+
7+
#Eagle Backup files
8+
*.s#?
9+
*.b#?
10+
*.l#?
11+
*.lck
12+
13+
# Folder config file
14+
Desktop.ini
15+
16+
# Recycle Bin used on file shares
17+
$RECYCLE.BIN/
18+
19+
# Windows Installer files
20+
*.cab
21+
*.msi
22+
*.msm
23+
*.msp
24+
25+
# =========================
26+
# Operating System Files
27+
# =========================
28+
29+
# OSX
30+
# =========================
31+
3032
.DS_Store
3133
.AppleDouble
3234
.LSOverride
3335

3436
# Icon must ends with two \r.
35-
Icon
37+
Icon
38+
3639

3740
# Thumbnails
3841
._*
1.7 MB
Binary file not shown.

Firmware/RTK_Surveyor/AP-Config/src/main.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,9 @@ function validateFields() {
285285
//Base Config
286286
checkElementValue("observationSeconds", 60, 600, "Must be between 60 to 600", "collapseBaseConfig");
287287
checkElementValue("observationPositionAccuracy", 1, 5.1, "Must be between 1.0 to 5.0", "collapseBaseConfig");
288-
checkElementValue("fixedEcefX", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
289-
checkElementValue("fixedEcefY", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
290-
if (ge("fixedEcefZ").value == 0.0) ge("fixedEcefZ").value = 4084500;
291-
checkElementValue("fixedEcefZ", 3300000, 5000000, "Must be 3300000 to 5000000", "collapseBaseConfig");
288+
checkElementValue("fixedEcefX", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
289+
checkElementValue("fixedEcefY", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
290+
checkElementValue("fixedEcefZ", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
292291
checkElementValue("fixedLat", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
293292
checkElementValue("fixedLong", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
294293
checkElementValue("fixedAltitude", -11034, 8849, "Must be -11034 to 8849", "collapseBaseConfig");

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void beginUART2()
271271
void pinUART2Task( void *pvParameters )
272272
{
273273
serialGNSS.setRxBufferSize(SERIAL_SIZE_RX);
274-
serialGNSS.setTimeout(0);
274+
serialGNSS.setTimeout(settings.serialTimeoutGNSS);
275275
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.
276276

277277
uart2pinned = true;

Firmware/RTK_Surveyor/Form.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ void createSettingsString(char* settingsCSV)
397397
stringRecord(settingsCSV, "externalPulsePolarity", settings.externalPulsePolarity);
398398
stringRecord(settingsCSV, "enableExternalHardwareEventLogging", settings.enableExternalHardwareEventLogging);
399399
stringRecord(settingsCSV, "profileName", settings.profileName);
400+
stringRecord(settingsCSV, "serialTimeoutGNSS", settings.serialTimeoutGNSS);
400401

401402
strcat(settingsCSV, "\0");
402403
Serial.printf("settingsCSV len: %d\n\r", strlen(settingsCSV));
@@ -511,6 +512,8 @@ void updateSettingWithValue(const char *settingName, const char* settingValueStr
511512
strcpy(settings.ntripClient_wifiPW, settingValueStr);
512513
else if (strcmp(settingName, "ntripClient_TransmitGGA") == 0)
513514
settings.ntripClient_TransmitGGA = settingValueBool;
515+
else if (strcmp(settingName, "serialTimeoutGNSS") == 0)
516+
settings.serialTimeoutGNSS = settingValue;
514517

515518
//Unused variables - read to avoid errors
516519
else if (strcmp(settingName, "measurementRateSec") == 0) {}

Firmware/RTK_Surveyor/NVM.ino

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ uint8_t getProfileNumber()
101101
else
102102
{
103103
profileNumber = fileProfileNumber.read();
104-
updateZEDSettings = fileProfileNumber.read();
105104
fileProfileNumber.close();
106105
}
107106

@@ -217,7 +216,7 @@ void recordProfileNumber(uint8_t profileNumber, bool markForUpdate)
217216
return;
218217
}
219218
fileProfileNumber.write(profileNumber);
220-
fileProfileNumber.write(markForUpdate); //If true, ZED will be config'd next POR
219+
fileProfileNumber.write(markForUpdate); //If true, ZED will be config'd next POR
221220
fileProfileNumber.close();
222221
}
223222

@@ -357,6 +356,7 @@ void recordSystemSettingsToFile()
357356
settingsFile.println("ntripClient_wifiSSID=" + (String)settings.ntripClient_wifiSSID);
358357
settingsFile.println("ntripClient_wifiPW=" + (String)settings.ntripClient_wifiPW);
359358
settingsFile.println("ntripClient_TransmitGGA=" + (String)settings.ntripClient_TransmitGGA);
359+
settingsFile.println("serialTimeoutGNSS=" + (String)settings.serialTimeoutGNSS);
360360

361361
//Record constellation settings
362362
for (int x = 0 ; x < MAX_CONSTELLATIONS ; x++)
@@ -633,9 +633,21 @@ bool parseLine(char* str) {
633633
}
634634
}
635635
else if (strcmp(settingName, "dataPortBaud") == 0)
636-
settings.dataPortBaud = d;
636+
{
637+
if (settings.dataPortBaud != d)
638+
{
639+
settings.dataPortBaud = d;
640+
updateZEDSettings = true;
641+
}
642+
}
637643
else if (strcmp(settingName, "radioPortBaud") == 0)
638-
settings.radioPortBaud = d;
644+
{
645+
if (settings.radioPortBaud != d)
646+
{
647+
settings.radioPortBaud = d;
648+
updateZEDSettings = true;
649+
}
650+
}
639651
else if (strcmp(settingName, "surveyInStartingAccuracy") == 0)
640652
settings.surveyInStartingAccuracy = d;
641653
else if (strcmp(settingName, "measurementRate") == 0)
@@ -786,6 +798,8 @@ bool parseLine(char* str) {
786798
strcpy(settings.ntripClient_wifiPW, settingValue);
787799
else if (strcmp(settingName, "ntripClient_TransmitGGA") == 0)
788800
settings.ntripClient_TransmitGGA = d;
801+
else if (strcmp(settingName, "serialTimeoutGNSS") == 0)
802+
settings.serialTimeoutGNSS = d;
789803

790804
//Check for bulk settings (constellations and message rates)
791805
//Must be last on else list

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
*/
4747

4848
const int FIRMWARE_VERSION_MAJOR = 1;
49-
const int FIRMWARE_VERSION_MINOR = 11;
49+
const int FIRMWARE_VERSION_MINOR = 12;
5050

5151
#define COMPILE_WIFI //Comment out to remove all WiFi functionality
5252
#define COMPILE_BT //Comment out to disable all Bluetooth

Firmware/RTK_Surveyor/form.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,9 @@ function validateFields() {
308308
//Base Config
309309
checkElementValue("observationSeconds", 60, 600, "Must be between 60 to 600", "collapseBaseConfig");
310310
checkElementValue("observationPositionAccuracy", 1, 5.1, "Must be between 1.0 to 5.0", "collapseBaseConfig");
311-
checkElementValue("fixedEcefX", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
312-
checkElementValue("fixedEcefY", -5000000, 5000000, "Must be -5000000 to 5000000", "collapseBaseConfig");
313-
if (ge("fixedEcefZ").value == 0.0) ge("fixedEcefZ").value = 4084500;
314-
checkElementValue("fixedEcefZ", 3300000, 5000000, "Must be 3300000 to 5000000", "collapseBaseConfig");
311+
checkElementValue("fixedEcefX", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
312+
checkElementValue("fixedEcefY", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
313+
checkElementValue("fixedEcefZ", -7000000, 7000000, "Must be -7000000 to 7000000", "collapseBaseConfig");
315314
checkElementValue("fixedLat", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
316315
checkElementValue("fixedLong", -180, 180, "Must be -180 to 180", "collapseBaseConfig");
317316
checkElementValue("fixedAltitude", -11034, 8849, "Must be -11034 to 8849", "collapseBaseConfig");

Firmware/RTK_Surveyor/menuSystem.ino

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ void menuDebug()
172172
if (settings.enableResetDisplay == true) Serial.println(F("Enabled"));
173173
else Serial.println(F("Disabled"));
174174

175+
Serial.print(F("9) GNSS Serial Timeout: "));
176+
Serial.println(settings.serialTimeoutGNSS);
177+
175178
Serial.println(F("e) Erase LittleFS"));
176179

177180
Serial.println(F("r) Force system reset"));
@@ -249,6 +252,19 @@ void menuDebug()
249252
recordSystemSettings(); //Record to NVM
250253
}
251254
}
255+
else if (incoming == '9')
256+
{
257+
Serial.print(F("Enter GNSS Serial Timeout in milliseconds (0 to 1000): "));
258+
uint16_t serialTimeoutGNSS = getNumber(menuTimeout); //Timeout after x seconds
259+
if (serialTimeoutGNSS < 0 || serialTimeoutGNSS > 1000) //Arbitrary 1s limit
260+
{
261+
Serial.println(F("Error: Timeout is out of range"));
262+
}
263+
else
264+
{
265+
settings.serialTimeoutGNSS = serialTimeoutGNSS; //Recorded to NVM and file at main menu exit
266+
}
267+
}
252268
else if (incoming == 'e')
253269
{
254270
Serial.println("Erasing LittleFS and resetting");

Firmware/RTK_Surveyor/settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ typedef struct struct_settings {
341341
char ntripClient_wifiPW[50] = "parachutes";
342342
bool ntripClient_TransmitGGA = true;
343343

344+
int16_t serialTimeoutGNSS = 1; //In ms - used during SerialGNSS.begin. Number of ms to pass of no data before hardware serial reports data available.
345+
344346
} Settings;
345347
Settings settings;
346348

0 commit comments

Comments
 (0)