Skip to content

Commit 07ac356

Browse files
committed
ALP only on neo6m; conditional resstarts on neo6m when AID has issues and others (always)
1 parent 5b282fa commit 07ac356

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/gps.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,14 @@ void Gps::begin() {
7272
configureGpsModule();
7373
}
7474
pollStatistics();
75-
if(is_neo8()) {
75+
if((!is_neo6()) || (!SD.exists(AID_INI_DATA_FILE_NAME))) {
76+
// we're on a non-6 neo and avoid AID_INI because is deprecated
77+
// or we're on a neo6 but last boot we didn't get far enough to receive fresh
78+
// ALP_INI data after initializing
79+
// so restart GPS for good measure.
80+
if (is_neo6()) log_i("We found no AID_INI on with neo6 on boot - coldstart gps in case its in a state where it doesn't get fixes");
81+
if (!is_neo6()) log_i("Coldstart because we found that newer neos profit from that.");
82+
7683
coldStartGps();
7784
}
7885
pollStatistics();
@@ -414,11 +421,15 @@ void Gps::enableAlpIfDataIsAvailable() {
414421
/* Poll or refresh one time statistics, also spends some time
415422
* to collect the results.
416423
*/
424+
417425
void Gps::pollStatistics() {
418-
handle();
419-
sendUbx(UBX_MSG::AID_ALP);
420426
handle();
421427
sendUbx(UBX_MSG::MON_VER);
428+
handle(20);
429+
if (is_neo6()){
430+
// AID_ALP is a neo6-only thing
431+
sendUbx(UBX_MSG::AID_ALP);
432+
}
422433
handle();
423434
sendUbx(UBX_MSG::MON_HW);
424435
handle();
@@ -1206,7 +1217,7 @@ void Gps::parseUbxMessage() {
12061217
mGpsUptime = mGpsBuffer.navStatus.msss;
12071218
if (mGpsBuffer.navStatus.ttff != 0) {
12081219
addStatisticsMessage("TimeToFix: " + String(mGpsBuffer.navStatus.ttff) + "ms");
1209-
} else if (!mAidIniSent) {
1220+
} else if (!mAidIniSent and is_neo6()) {
12101221
mAidIniSent = true;
12111222
aidIni();
12121223
}

src/utils/alpdata.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ size_t AlpData::loadMessage(uint8_t *data, size_t size) {
172172
result = f.read(data, size);
173173
f.close();
174174
log_d("Read %d bytes", result);
175+
SD.remove(AID_INI_DATA_FILE_NAME);
175176
}
176177
return result;
177178
}

0 commit comments

Comments
 (0)