Skip to content

Time shift after udp->flush is removed #22

Description

@PeterAckermans

The flush at the start of ntpUpdate() is mandatory to keep the NTP server in sync after an UDP timeout.
If you leave out the flush sometimes suddenly an exact NTP::updateInterval timeshift will happen.

The code I use to fix this was:

bool NTP::ntpUpdate() {
// flush any existing pending input packets
while(udp->parsePacket() != 0) udp->flush();
if (server == nullptr) udp->beginPacket(serverIP, NTP_PORT);
else udp->beginPacket(server, NTP_PORT);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions