From 776f05255fbed9d7beecf03759215641c74188c5 Mon Sep 17 00:00:00 2001 From: jcorgan Date: Tue, 10 Feb 2009 16:35:17 +0000 Subject: Merged r10418:10423 from jcorgan/pps into trunk. Adds usrp2::sync_every_pps git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10424 221aa14e-8319-0410-a670-987f0aec2ac5 --- usrp2/firmware/apps/app_common_v2.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'usrp2/firmware/apps/app_common_v2.c') diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c index c277d12f0..df943a4ee 100644 --- a/usrp2/firmware/apps/app_common_v2.c +++ b/usrp2/firmware/apps/app_common_v2.c @@ -54,6 +54,18 @@ sync_to_pps(const op_generic_t *p) return true; } +static bool +sync_every_pps(const op_generic_t *p) +{ + // FIXME use bit fields or defined masks + if (p->ok) + timesync_regs->tick_control |= 16; + else + timesync_regs->tick_control &= ~16; + + return true; +} + static bool config_mimo_cmd(const op_config_mimo_t *p) { @@ -505,6 +517,11 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len) subpktlen = generic_reply(gp, reply_payload, reply_payload_space, true); break; + case OP_SYNC_EVERY_PPS: + subpktlen = generic_reply(gp, reply_payload, reply_payload_space, + sync_every_pps((op_generic_t *) payload)); + break; + default: printf("app_common_v2: unhandled opcode = %d\n", gp->opcode); break; -- cgit