commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r6129 - gnuradio/trunk/gr-usrp/src


From: matt
Subject: [Commit-gnuradio] r6129 - gnuradio/trunk/gr-usrp/src
Date: Thu, 9 Aug 2007 05:54:21 -0600 (MDT)

Author: matt
Date: 2007-08-09 05:54:21 -0600 (Thu, 09 Aug 2007)
New Revision: 6129

Modified:
   gnuradio/trunk/gr-usrp/src/db_flexrf.py
Log:
minor fixes


Modified: gnuradio/trunk/gr-usrp/src/db_flexrf.py
===================================================================
--- gnuradio/trunk/gr-usrp/src/db_flexrf.py     2007-08-08 20:06:14 UTC (rev 
6128)
+++ gnuradio/trunk/gr-usrp/src/db_flexrf.py     2007-08-09 11:54:21 UTC (rev 
6129)
@@ -98,7 +98,7 @@
         Adds 10ms delay between writing control and N if this is first call.
         This is the required power-up sequence.
         
-        @param $: 24-bit R counter latch
+        @param R: 24-bit R counter latch
         @type R: int
         @param control: 24-bit control latch
         @type control: int
@@ -345,6 +345,7 @@
         @returns True/False
         """
         maxgain = self.gain_range()[1] - self._u.pga_max()
+        mingain = self.gain_range()[0]
         if gain > maxgain:
             pga_gain = gain-maxgain
             assert pga_gain <= self._u.pga_max()
@@ -355,7 +356,7 @@
         V_maxgain = .2
         V_mingain = 1.2
         V_fullscale = 3.3
-        dac_value = (agc_gain*(V_maxgain-V_mingain)/maxgain + 
V_mingain)*4096/V_fullscale
+        dac_value = (agc_gain*(V_maxgain-V_mingain)/(maxgain-mingain) + 
V_mingain)*4096/V_fullscale
         assert dac_value>=0 and dac_value<4096
         return self._u.write_aux_dac(self._which, 0, int(dac_value)) and \
                self._set_pga(int(pga_gain))





reply via email to

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