void clock_tick(void) { #ifdef NTP_SUPPORT if(ntp_timer) { if((-- ntp_timer) == 0) ntp_send_packet(); } if(timestamp <= 50 && (timestamp % 5 == 0)) ntp_send_packet(); #endif /* Only clock here, when no crystal is connected */ #ifndef CLOCK_CRYSTAL_SUPPORT # /* Don't wait for a sync, if no sync source is enabled */ #if defined(NTP_SUPPORT) || defined(DCF77_SUPPORT) if(sync_timestamp <= timestamp) #endif timestamp ++; #endif }
void clock_periodic(void) { #ifdef NTP_SUPPORT if (ntp_timer) ntp_timer--; else { /* Retry in ~10 seconds */ ntp_timer = 10; ntp_send_packet(); } #endif }
int16_t parse_cmd_ntp_query(char *cmd, char *output, uint16_t len) { ntp_send_packet(); return ECMD_FINAL_OK; }