@@ -59,12 +59,7 @@ void atxcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
5959 pdaBar->writeRegister ((baseAddress + 4 * 0x000 ) / 4 , 0x02 ); // ...
6060
6161 // b. Validate that user has control
62- // TODO(cru-sw): There should be a check here...
63- uint32_t bit = waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
64- if (bit != 0 ) {
65- std::cout << " atxcal0 0" << std::endl;
66- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" atxcal0: User does not have control" ));
67- }
62+ waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
6863
6964 // c. Enable ATX PLL alibration
7065 pdaBar->modifyRegister ((baseAddress + 4 * 0x100 ) / 4 , 0 , 1 , 0x1 );
@@ -73,11 +68,7 @@ void atxcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
7368 pdaBar->modifyRegister ((baseAddress + 4 * 0x000 ) / 4 , 0 , 8 , 0x1 );
7469
7570 // e. Wait...
76- bit = waitForBit (pdaBar, baseAddress + 4 * 0x280 , 1 , 0 );
77- if (bit != 0 ) {
78- std::cout << " atxcal0 1" << std::endl;
79- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" atxcal0: User does not have control" ));
80- }
71+ waitForBit (pdaBar, baseAddress + 4 * 0x280 , 1 , 0 );
8172
8273 // f. Calibration complete...
8374}
@@ -90,11 +81,7 @@ void txcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
9081 pdaBar->writeRegister ((baseAddress + 4 * 0x000 ) / 4 , 0x2 );
9182
9283 // b. Validate that user has control
93- uint32_t bit = waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
94- if (bit != 0 ) {
95- std::cout << " txcal0 0" << std::endl;
96- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" txcal0: User does not have control" ));
97- }
84+ waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
9885
9986 // c. Mask out rx_cal_busy...
10087 pdaBar->modifyRegister ((baseAddress + 4 * 0x281 ) / 4 , 5 , 1 , 0x0 );
@@ -107,11 +94,7 @@ void txcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
10794 pdaBar->modifyRegister ((baseAddress + 4 * 0x000 ) / 4 , 0 , 8 , 0x1 );
10895
10996 // f. Wait..
110- bit = waitForBit (pdaBar, baseAddress + 4 * 0x281 , 1 , 0 );
111- if (bit != 0 ) {
112- std::cout << " txcal0 1" << std::endl;
113- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" txcal0: User does not have control" ));
114- }
97+ waitForBit (pdaBar, baseAddress + 4 * 0x281 , 1 , 0 );
11598
11699 // g. Calibration is complete
117100
@@ -126,11 +109,7 @@ void rxcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
126109 pdaBar->writeRegister ((baseAddress + 4 * 0x000 ) / 4 , 0x2 );
127110
128111 // b. Validate that user has control
129- uint32_t bit = waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
130- if (bit != 0 ) {
131- std::cout << " rxcal0 0" << std::endl;
132- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" rxcal0: User does not have control" ));
133- }
112+ waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
134113
135114 // c. Mask out tx_cal_busy...
136115 pdaBar->modifyRegister ((baseAddress + 4 * 0x281 ) / 4 , 4 , 1 , 0x0 );
@@ -145,11 +124,7 @@ void rxcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress)
145124 pdaBar->modifyRegister ((baseAddress + 4 * 0x000 ) / 4 , 0 , 8 , 0x1 );
146125
147126 // g. Wait..
148- bit = waitForBit (pdaBar, baseAddress + 4 * 0x281 , 1 , 0 );
149- if (bit != 0 ) {
150- std::cout << " rxcal0 1" << std::endl;
151- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" rxcal0: User does not have control" ));
152- }
127+ waitForBit (pdaBar, baseAddress + 4 * 0x281 , 1 , 0 );
153128
154129 // h. Calibration is complete
155130
@@ -183,10 +158,7 @@ void fpllcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress, bool co
183158 pdaBar->modifyRegister ((baseAddress + 4 * 0x000 ) / 4 , 0 , 8 , 0x02 );
184159
185160 // b. Validate that user has control
186- uint32_t bit = waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
187- if (bit != 0 ) {
188- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" fpllcal0: User does not have control" ));
189- }
161+ waitForBit (pdaBar, baseAddress + 4 * 0x280 , 2 , 0 );
190162
191163 // c. Enable fPLL calibration
192164 pdaBar->modifyRegister ((baseAddress + 4 * 0x100 ) / 4 , 1 , 1 , 0x1 );
@@ -195,10 +167,7 @@ void fpllcal0(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t baseAddress, bool co
195167 pdaBar->modifyRegister ((baseAddress + 4 * 0x000 ) / 4 , 0 , 8 , 0x1 );
196168
197169 // e. Wait...
198- bit = waitForBit (pdaBar, baseAddress + 4 * 0x280 , 1 , 0 );
199- if (bit != 0 ) {
200- BOOST_THROW_EXCEPTION (Exception () << ErrorInfo::Message (" fpllcal0: User does not have control" ));
201- }
170+ waitForBit (pdaBar, baseAddress + 4 * 0x280 , 1 , 0 );
202171
203172 // f. Calibration is complete
204173
@@ -217,7 +186,7 @@ uint32_t waitForBit(std::shared_ptr<Pda::PdaBar> pdaBar, uint32_t address, uint3
217186 uint32_t readValue = pdaBar->readRegister (address / 4 );
218187 uint32_t bit = Utilities::getBit (readValue, position);
219188
220- while ((elapsed <= std::chrono::milliseconds (800 )) && bit != value) {
189+ while ((elapsed <= std::chrono::milliseconds (500 )) && bit != value) {
221190 readValue = pdaBar->readRegister (address / 4 );
222191 bit = Utilities::getBit (readValue, position);
223192 curr = std::chrono::system_clock::now ();
0 commit comments