gpsread fixes

This commit is contained in:
cyberman54 2019-03-02 22:56:00 +01:00
parent 19dd7c8e33
commit 1ae444b342
3 changed files with 10 additions and 10 deletions

View File

@ -92,14 +92,17 @@ time_t get_gpstime(void) {
time_t t = 0; time_t t = 0;
if ((gps.time.age() < gpsDelay_ms) && (gps.time.isValid()) && (gps.date.isValid())) { if ((gps.time.age() < gpsDelay_ms) && (gps.time.isValid()) &&
(gps.date.isValid())) {
ESP_LOGD(TAG, "GPS time age: %dms, second: %d, is valid: %s", gps.time.age(), gps.time.second(), ESP_LOGD(TAG, "GPS time age: %dms, is valid: %s, second: %d,",
gps.time.isValid() ? "yes" : "no"); gps.time.age(),
(gps.time.isValid() && gps.date.isValid()) ? "yes" : "no",
gps.time.second());
t = tmConvert(gps.date.year(), gps.date.month(), gps.date.day(), t = tmConvert(gps.date.year(), gps.date.month(), gps.date.day(),
gps.time.hour(), gps.time.minute(), gps.time.second()); gps.time.hour(), gps.time.minute(), gps.time.second());
} }
return timeIsValid(t); return timeIsValid(t);
} // get_gpstime() } // get_gpstime()

View File

@ -92,9 +92,7 @@ void IF482_Pulse(time_t t) {
static const TickType_t txDelay = static const TickType_t txDelay =
pdMS_TO_TICKS(IF482_PULSE_LENGTH - tx_Ticks(IF482_FRAME_SIZE, HAS_IF482)); pdMS_TO_TICKS(IF482_PULSE_LENGTH - tx_Ticks(IF482_FRAME_SIZE, HAS_IF482));
//TickType_t startTime = xTaskGetTickCount(); vTaskDelay(txDelay); // wait until moment to fire
//vTaskDelayUntil(&startTime, txDelay); // wait until moment to fire
vTaskDelay(txDelay); // wait until moment to fire
IF482.print(IF482_Frame(t + 1)); // note: if482 telegram for *next* second IF482.print(IF482_Frame(t + 1)); // note: if482 telegram for *next* second
} }

View File

@ -101,7 +101,6 @@ void timepulse_start(void) {
void IRAM_ATTR CLOCKIRQ(void) { void IRAM_ATTR CLOCKIRQ(void) {
BaseType_t xHigherPriorityTaskWoken; BaseType_t xHigherPriorityTaskWoken;
time_t t = SyncToPPS(); // calibrates UTC systime, see Time.h time_t t = SyncToPPS(); // calibrates UTC systime, see Time.h
xHigherPriorityTaskWoken = pdFALSE; xHigherPriorityTaskWoken = pdFALSE;