summaryrefslogtreecommitdiff
path: root/usrp2/firmware
diff options
context:
space:
mode:
authorjcorgan2008-12-14 01:01:11 +0000
committerjcorgan2008-12-14 01:01:11 +0000
commitf2695be7c09fec1bc5b62f3b229b9002572aeb30 (patch)
tree231b06c32f76dbc74506423004af6a6d18c8163c /usrp2/firmware
parent0a5eb9fc28515627ef6d2937e26aadd0a4fd53cf (diff)
downloadgnuradio-f2695be7c09fec1bc5b62f3b229b9002572aeb30.tar.gz
gnuradio-f2695be7c09fec1bc5b62f3b229b9002572aeb30.tar.bz2
gnuradio-f2695be7c09fec1bc5b62f3b229b9002572aeb30.zip
Implement sync_to_pps command for USRP2
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10116 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2/firmware')
-rw-r--r--usrp2/firmware/apps/app_common_v2.c12
-rw-r--r--usrp2/firmware/include/usrp2_eth_packet.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c
index d58ea8a41..0777ee090 100644
--- a/usrp2/firmware/apps/app_common_v2.c
+++ b/usrp2/firmware/apps/app_common_v2.c
@@ -47,6 +47,14 @@ burn_mac_addr(const op_burn_mac_addr_t *p)
}
static bool
+sync_to_pps(const op_generic_t *p)
+{
+ timesync_regs->sync_on_next_pps = 1;
+ putstr("SYNC to PPS\n");
+ return true;
+}
+
+static bool
config_mimo_cmd(const op_config_mimo_t *p)
{
clocks_mimo_config(p->flags);
@@ -422,6 +430,10 @@ handle_control_chan_frame(u2_eth_packet_t *pkt, size_t len)
subpktlen = dboard_info_cmd(gp, reply_payload, reply_payload_space);
break;
+ case OP_SYNC_TO_PPS:
+ subpktlen = generic_reply(gp, reply_payload, reply_payload_space,
+ sync_to_pps((op_generic_t *) payload));
+
default:
printf("app_common_v2: unhandled opcode = %d\n", gp->opcode);
break;
diff --git a/usrp2/firmware/include/usrp2_eth_packet.h b/usrp2/firmware/include/usrp2_eth_packet.h
index ed3ce1fe3..cfff0dd08 100644
--- a/usrp2/firmware/include/usrp2_eth_packet.h
+++ b/usrp2/firmware/include/usrp2_eth_packet.h
@@ -183,6 +183,8 @@ typedef struct {
#define OP_CONFIG_MIMO_REPLY (OP_CONFIG_MIMO | OP_REPLY_BIT)
#define OP_DBOARD_INFO 9
#define OP_DBOARD_INFO_REPLY (OP_DBOARD_INFO | OP_REPLY_BIT)
+#define OP_SYNC_TO_PPS 10
+#define OP_SYNC_TO_PPS_REPLY (OP_SYNC_TO_PPS | OP_REPLY_BIT)
//#define OP_WRITE_REG xx // not implemented