Commit c418f210 authored by Zhiping Jiang (蒋志平)'s avatar Zhiping Jiang (蒋志平) 💬

EchoProbe: batter ath9kPLLBandwidthComputation

parent 2d4468a6
......@@ -34,7 +34,7 @@ void EchoProbeInitiator::unifiedEchoProbeWork() {
parameters->continue2Work = true;
auto dumperId = fmt::sprintf("rxack_%s", hal->phyId);
do {
auto bb_rate_mhz = ath9kPLLBandwidthComputation(cur_pll, hal->getPLLRefDiv(), hal->getPLLClockSelect()) / 1e6 * (*parameters->bw == 40 ? 2 : 1);
auto bb_rate_mhz = ath9kPLLBandwidthComputation(cur_pll, hal->getPLLRefDiv(), hal->getPLLClockSelect(), (*parameters->bw == 40 ? true : false)) / 1e6;
if (workingMode == MODE_Injector && (cur_pll != hal->getPLLMultipler() || cur_cf != hal->getCarrierFreq())) {
if (cur_pll != hal->getPLLMultipler()) {
LoggingService::info_print("EchoProbe injector shifting {}'s BW to {}MHz...\n", hal->phyId, bb_rate_mhz);
......
......@@ -56,7 +56,7 @@ bool EchoProbeResponder::handle(const struct RXS_enhanced *received_rxs) {
std::this_thread::sleep_for(std::chrono::microseconds(*parameters->delay_after_cf_change_us));
if (pll_rate > 0 && hal->getPLLMultipler() != pll_rate) {
auto bb_rate_mhz = ath9kPLLBandwidthComputation(pll_rate, pll_refdiv, pll_clock_select) / 1e6 * (*parameters->bw == 40 ? 2 : 1);
auto bb_rate_mhz = ath9kPLLBandwidthComputation(pll_rate, pll_refdiv, pll_clock_select, (*parameters->bw == 40 ? true : false)) / 1e6;
LoggingService::info_print("EchoProbe responder shifting {}'s BW to {}MHz...\n", hal->phyId, bb_rate_mhz);
hal->setPLLValues(pll_rate, pll_refdiv, pll_clock_select);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment