summaryrefslogtreecommitdiff
path: root/usrp2/firmware
diff options
context:
space:
mode:
authorjcorgan2009-02-17 17:19:48 +0000
committerjcorgan2009-02-17 17:19:48 +0000
commit68495fa71f0845671ecd34b9fe69e9573c42456c (patch)
treea799c87332052e33272bb2df0566673e801a3e8c /usrp2/firmware
parent4c84464a17b1a89a733846bd194ba7cedb1e4429 (diff)
downloadgnuradio-68495fa71f0845671ecd34b9fe69e9573c42456c.tar.gz
gnuradio-68495fa71f0845671ecd34b9fe69e9573c42456c.tar.bz2
gnuradio-68495fa71f0845671ecd34b9fe69e9573c42456c.zip
Use defined bit positions
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10454 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'usrp2/firmware')
-rw-r--r--usrp2/firmware/apps/app_common_v2.c5
-rw-r--r--usrp2/firmware/lib/memory_map.h9
2 files changed, 9 insertions, 5 deletions
diff --git a/usrp2/firmware/apps/app_common_v2.c b/usrp2/firmware/apps/app_common_v2.c
index df943a4ee..62e54f9a0 100644
--- a/usrp2/firmware/apps/app_common_v2.c
+++ b/usrp2/firmware/apps/app_common_v2.c
@@ -57,11 +57,10 @@ sync_to_pps(const op_generic_t *p)
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;
+ timesync_regs->tick_control |= TSC_EVERYPPS;
else
- timesync_regs->tick_control &= ~16;
+ timesync_regs->tick_control &= ~TSC_EVERYPPS;
return true;
}
diff --git a/usrp2/firmware/lib/memory_map.h b/usrp2/firmware/lib/memory_map.h
index f4bf42010..f3901978e 100644
--- a/usrp2/firmware/lib/memory_map.h
+++ b/usrp2/firmware/lib/memory_map.h
@@ -1,6 +1,6 @@
/* -*- c -*- */
/*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2009 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -625,7 +625,6 @@ typedef struct {
///////////////////////////////////////////////////
// Time Sync Controller, Slave 12
-
#define TIMESYNC_BASE 0xE800
typedef struct {
@@ -656,6 +655,12 @@ typedef struct {
#define timesync_regs ((timesync_regs_t *) TIMESYNC_BASE)
+#define TSC_SOURCE (1 << 0)
+#define TSC_IENABLE (1 << 1)
+#define TSC_EXTSYNC (1 << 2)
+#define TSC_PPSEDGE (1 << 3)
+#define TSC_EVERYPPS (1 << 4)
+
///////////////////////////////////////////////////
// SD Card SPI interface, Slave 13
// All regs are 8 bits wide, but are accessed as if they are 32 bits