GPS timing fine tuning

This commit is contained in:
Verkehrsrot 2019-08-04 23:18:04 +02:00
parent c81502ac60
commit be208ab539
2 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@
#endif #endif
#define NMEA_FRAME_SIZE 82 // NEMA has a maxium of 82 bytes per record #define NMEA_FRAME_SIZE 82 // NEMA has a maxium of 82 bytes per record
#define NMEA_COMPENSATION_FACTOR 480 // empiric for Ublox Neo 6M
extern TinyGPSPlus gps; // Make TinyGPS++ instance globally availabe extern TinyGPSPlus gps; // Make TinyGPS++ instance globally availabe
extern TaskHandle_t GpsTask; extern TaskHandle_t GpsTask;

View File

@ -95,7 +95,7 @@ time_t fetch_gpsTime(uint16_t *msec) {
#endif #endif
// wait for gps NMEA answer // wait for gps NMEA answer
vTaskDelay(tx_Ticks(NMEA_FRAME_SIZE, GPS_SERIAL)); //vTaskDelay(tx_Ticks(NMEA_FRAME_SIZE, GPS_SERIAL));
// did we get a current time? // did we get a current time?
if (gpstime.isUpdated() && gpstime.isValid()) { if (gpstime.isUpdated() && gpstime.isValid()) {
@ -104,7 +104,7 @@ time_t fetch_gpsTime(uint16_t *msec) {
String rawtime = gpstime.value(); String rawtime = gpstime.value();
uint32_t time_bcd = rawtime.toFloat() * 100; uint32_t time_bcd = rawtime.toFloat() * 100;
uint32_t delay_ms = gpstime.age() + nmea_txDelay_ms; uint32_t delay_ms = gpstime.age() + nmea_txDelay_ms + NMEA_COMPENSATION_FACTOR;
uint8_t year = uint8_t year =
CalendarYrToTm(gps.date.year()); // year offset from 1970 in microTime.h CalendarYrToTm(gps.date.year()); // year offset from 1970 in microTime.h