Commit e22b17ba authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

tests/measure_t24p.c: support for ppsi implemented

Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 2ec584a6
......@@ -24,7 +24,15 @@
#undef PACKED
#include "ptpd_netif.h"
#ifdef CONFIG_PPSI
#include <ppsi/ppsi.h>
#define UNPACK_HEADER msg_unpack_header
#define UNPACK_FOLLOWUP msg_unpack_follow_up
#else
#include "ptpd.h"
#define UNPACK_HEADER msgUnpackHeader
#define UNPACK_FOLLOWUP msgUnpackFollowUp
#endif
#if 0 /* not used, currently */
static int get_bitslide(int ep)
......@@ -74,12 +82,12 @@ static int meas_phase_range(wr_socket_t * sock, int phase_min, int phase_max,
int n = ptpd_netif_recvfrom(sock, &from, buf, 128, &ts_rx);
if (n > 0) {
msgUnpackHeader(buf, &mhdr);
UNPACK_HEADER(buf, &mhdr);
if (mhdr.messageType == 0)
ts_sync = ts_rx;
else if (mhdr.messageType == 8 && ts_sync.correct) {
MsgFollowUp fup;
msgUnpackFollowUp(buf, &fup);
UNPACK_FOLLOWUP(buf, &fup);
mprintf("Shift: %d/%dps [step %dps] \r",
setpoint, phase_max, phase_step);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment