Fix feedback divider value approximation
* The rounding algorithm here expects to start with the 2 digits after the decimal point in pll->feedbackDivFrac. Multiplying with 1000 instead of 100 filled it with 3 digits. The last step then set the fractional part to zero because it was still too large.
This commit is contained in:
parent
edf1552770
commit
34d3dff3f5
@ -374,7 +374,7 @@ pll_compute(pll_info* pll)
|
||||
pll->feedbackDiv = pll->minFeedbackDiv;
|
||||
|
||||
pll->feedbackDivFrac
|
||||
= (1000 * pll->feedbackDivFrac) / pll->referenceFreq;
|
||||
= (100 * pll->feedbackDivFrac) / pll->referenceFreq;
|
||||
|
||||
if (pll->feedbackDivFrac >= 5) {
|
||||
pll->feedbackDivFrac -= 5;
|
||||
|
Loading…
Reference in New Issue
Block a user