ftdipp_mpsse: typo in setClkFreq

This commit is contained in:
Gwenhael Goavec-Merou 2021-09-16 07:41:05 +02:00
parent 85b53b5918
commit 57c0f16be4
1 changed files with 3 additions and 3 deletions

View File

@ -255,17 +255,17 @@ int FTDIpp_MPSSE::setClkFreq(uint32_t clkHZ)
if (use_divide_by_5) { if (use_divide_by_5) {
if (_clkHZ > 6000000) { if (_clkHZ > 6000000) {
printWarn("Jtag probe limited to 60MHz"); printWarn("Jtag probe limited to 6MHz");
_clkHZ = 6000000; _clkHZ = 6000000;
} }
} else { } else {
if (_clkHZ > 30000000) { if (_clkHZ > 30000000) {
printWarn("Jtag probe limited to 30MHz"); printWarn("Jtag probe limited to 30MHz");
_clkHZ = 3000000; _clkHZ = 30000000;
} }
} }
presc = (base_freq /(_clkHZ * 2)) -1; presc = ((base_freq /_clkHZ) -1) / 2;
real_freq = base_freq / ((1+presc)*2); real_freq = base_freq / ((1+presc)*2);
if (real_freq > _clkHZ) if (real_freq > _clkHZ)
presc ++; presc ++;