Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/ntp/libparse/clk_meinberg.c
Show First 20 Lines • Show All 428 Lines • ▼ Show 20 Lines | |||||
mbg_input( | mbg_input( | ||||
parse_t *parseio, | parse_t *parseio, | ||||
char ch, | char ch, | ||||
timestamp_t *tstamp | timestamp_t *tstamp | ||||
) | ) | ||||
{ | { | ||||
unsigned int rtc; | unsigned int rtc; | ||||
parseprintf(DD_PARSE, ("mbg_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); | parseprintf(DD_PARSE, ("mbg_input(0x%p, 0x%x, ...)\n", (void*)parseio, ch)); | ||||
switch (ch) | switch (ch) | ||||
{ | { | ||||
case STX: | case STX: | ||||
parseprintf(DD_PARSE, ("mbg_input: STX seen\n")); | parseprintf(DD_PARSE, ("mbg_input: STX seen\n")); | ||||
parseio->parse_index = 1; | parseio->parse_index = 1; | ||||
parseio->parse_data[0] = ch; | parseio->parse_data[0] = ch; | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | gps_input( | ||||
) | ) | ||||
{ | { | ||||
CSUM calc_csum; /* used to compare the incoming csums */ | CSUM calc_csum; /* used to compare the incoming csums */ | ||||
GPS_MSG_HDR header; | GPS_MSG_HDR header; | ||||
struct msg_buf *msg_buf; | struct msg_buf *msg_buf; | ||||
msg_buf = (struct msg_buf *)parseio->parse_pdata; | msg_buf = (struct msg_buf *)parseio->parse_pdata; | ||||
parseprintf(DD_PARSE, ("gps_input(0x%lx, 0x%x, ...)\n", (long)parseio, ch)); | parseprintf(DD_PARSE, ("gps_input(0x%p, 0x%x, ...)\n", (void*)parseio, ch)); | ||||
if (!msg_buf) | if (!msg_buf) | ||||
return PARSE_INP_SKIP; | return PARSE_INP_SKIP; | ||||
if ( msg_buf->phase == MBG_NONE ) | if ( msg_buf->phase == MBG_NONE ) | ||||
{ /* not receiving yet */ | { /* not receiving yet */ | ||||
switch (ch) | switch (ch) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |