commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8401 - usrp2/trunk/firmware/lib


From: matt
Subject: [Commit-gnuradio] r8401 - usrp2/trunk/firmware/lib
Date: Sun, 11 May 2008 18:31:41 -0600 (MDT)

Author: matt
Date: 2008-05-11 18:31:41 -0600 (Sun, 11 May 2008)
New Revision: 8401

Modified:
   usrp2/trunk/firmware/lib/db_tvrx.c
Log:
gain control seems to work, need to check the limits


Modified: usrp2/trunk/firmware/lib/db_tvrx.c
===================================================================
--- usrp2/trunk/firmware/lib/db_tvrx.c  2008-05-12 00:25:21 UTC (rev 8400)
+++ usrp2/trunk/firmware/lib/db_tvrx.c  2008-05-12 00:31:41 UTC (rev 8401)
@@ -164,6 +164,7 @@
 tvrx_init(struct db_base *dbb)
 {
   struct db_tvrx_dummy *db = (struct db_tvrx_dummy *) dbb;
+  db->base.set_gain(dbb,U2_DOUBLE_TO_FXPT_GAIN(94.0));
   return true;
 }
 
@@ -220,9 +221,13 @@
   int if_slope_q8 = 256 * 4096 * 2.1 / 35.0 / 1.22 / 3.3;
   int if_offset_q8 = 256 * 4096 * 1.4 / 1.22 / 3.3;
 
-  lsdac_write_rx(0,(rfgain*rf_slope_q8 + rf_offset_q8)>>15);
-  lsdac_write_rx(1,(ifgain*if_slope_q8 + if_offset_q8)>>15);
+  
+  int rfdac = (rfgain*rf_slope_q8 + rf_offset_q8)>>15;
+  int ifdac = (ifgain*if_slope_q8 + if_offset_q8)>>15;
+  lsdac_write_rx(0,rfdac);
+  lsdac_write_rx(1,ifdac);
 
+  printf("Setting gain %d, rf %d, if %d\n",gain,rfdac,ifdac);
   return true;
 }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]