diff --git a/src/gpsread.cpp b/src/gpsread.cpp index 262daf0a..bcefd2a2 100644 --- a/src/gpsread.cpp +++ b/src/gpsread.cpp @@ -90,13 +90,12 @@ time_t fetch_gpsTime(uint16_t *msec) { // poll NMEA $GPZDA sentence #ifdef GPS_SERIAL GPS_Serial.print(ZDA_Request); + // wait for gps NMEA answer + vTaskDelay(tx_Ticks(NMEA_FRAME_SIZE, GPS_SERIAL)); #elif defined GPS_I2C Wire.print(ZDA_Request); #endif - // wait for gps NMEA answer - //vTaskDelay(tx_Ticks(NMEA_FRAME_SIZE, GPS_SERIAL)); - // did we get a current time? if (gpstime.isUpdated() && gpstime.isValid()) { @@ -104,7 +103,8 @@ time_t fetch_gpsTime(uint16_t *msec) { String rawtime = gpstime.value(); uint32_t time_bcd = rawtime.toFloat() * 100; - uint32_t delay_ms = gpstime.age() + nmea_txDelay_ms + NMEA_COMPENSATION_FACTOR; + uint32_t delay_ms = + gpstime.age() + nmea_txDelay_ms + NMEA_COMPENSATION_FACTOR; uint8_t year = CalendarYrToTm(gps.date.year()); // year offset from 1970 in microTime.h