vanvught / rpidmx512

Orange Pi DMX512 / RDM / MIDI / OSC / Art-Net / WS28xx / L6470 / Stepper / TLC59711 / PCA9685 / Servo / PWM / TCNet / SMPTE / RDMNet / LLRP / GD32 / GigaDevice / Raspberry Pi
http://www.orangepi-dmx.org/
MIT License
391 stars 109 forks source link

LTC SMPTE: GPS Time Client: 1 second behind #235

Closed vanvught closed 2 years ago

vanvught commented 2 years ago

When PPS is received, then it is one second after the latest time received.

https://github.com/vanvught/rpidmx512/blob/development/lib-gps/src/gpstimeclient.cpp#L94

        if (platform_is_pps()) {
            struct timeval tv;
            tv.tv_sec = GetLocalSeconds();
            tv.tv_usec = 0;
            settimeofday(&tv, nullptr);

            s_Status = Status::WAITING_TIMEOUT;

            DEBUG_PUTS("PPS handled");
            return;
        }

Hence the above code gives the time 1 second slow.

u-blox 7 Receiver Description Including Protocol Specification V14

cc: @hippyau @rbarreiros @wyged @drummerclint @dmpw-jan