Skip to content

Commit 7b865b9

Browse files
committed
Be more relaxed in GPS timings
- allows support of some variants of GPS modules
1 parent c97a4d2 commit 7b865b9

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

src/gps.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,14 @@ void Gps::sendUbxDirect() {
139139

140140
/* Resets the stored GPS config and stores our config! */
141141
void Gps::configureGpsModule() {
142-
// Clear configuration, RESET TO DEFAULT
143-
const uint8_t UBX_CFG_CFG_CLR[] = {
144-
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
145-
0xFE, 0xFF, 0x00, 0x00, 0x03
146-
};
147-
#ifdef UBX_M10
148-
// It is fairly stupid to reset the config here, as the baud rate will be reset (at least for M10)
149-
//sendUbx(UBX_MSG::CFG_CFG, UBX_CFG_CFG_CLR, sizeof(UBX_CFG_CFG_CLR)); // Newer devices will not answer this request
150-
#endif
151-
#ifdef UBX_M6
152-
sendAndWaitForAck(UBX_MSG::CFG_CFG, UBX_CFG_CFG_CLR, sizeof(UBX_CFG_CFG_CLR));
153-
#endif
154-
handle(300);
155-
156-
log_d("Start CFG");
142+
// The CFG_CFG_CLR caused trouble on newer modules - connection settings get reset.
143+
// no CFG_CFG_CLR for now if this fails we might need more fine-grained
144+
// reset
145+
// const uint8_t UBX_CFG_CFG_CLR[] = {
146+
// 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
147+
// 0xFE, 0xFF, 0x00, 0x00, 0x03
148+
// };
149+
log_i("Start GPS CFG");
157150
#ifdef UBX_M6
158151
// INF messages via UBX only
159152
const uint8_t UBX_CFG_INF_UBX[] = {
@@ -1286,7 +1279,7 @@ void Gps::handleUbxNavTimeGps(const GpsBuffer::UbxNavTimeGps &message, const uin
12861279
mIncomingGpsRecord.setWeek(mLastGpsWeek);
12871280
}
12881281
if ((message.valid & 0x03) == 0x03 // WEEK && TOW
1289-
&& delayMs < 20
1282+
&& delayMs < 200 // FIXME: needs to be lower once we have multi GPS versions support 20
12901283
&& message.tAcc < (20 * 1000 * 1000 /* 20ms */)
12911284
&& (mLastTimeTimeSet == 0
12921285
|| (mLastTimeTimeSet + (2 * 60 * 1000 /* 2 minutes */)) < receivedMs)) {

0 commit comments

Comments
 (0)