Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
pllgen: Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeckmann committed Apr 7, 2022
1 parent a792adb commit 80c3ce1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tools/pllgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
for fracn2 in range(0, 8191):
for divm2 in range(1, 64):
for divn2 in range(8, 421):
for divp2 in range(1, 129):
freq = ((hsi / divm2) * (divn2 + fracn2 / (1<<13))) / divp2 / 2048
error = abs(1.0 - args.samplerate / freq)
if freq == args.samplerate:
print(f"DIVM2={divm2}, DIVN2={divn2}, FRACN2={fracn2} DIVP2={divp2} => {freq}")
elif error < args.error:
print(f"DIVM2={divm2}, DIVN2={divn2}, FRACN2={fracn2} DIVP2={divp2} => {freq:.5f}, error={error * 100:.5f}%")
for divp2 in range(1, 129):
freq = ((hsi / divm2) * (divn2 + fracn2 / (1<<13))) / divp2 / 2048
error = abs(1.0 - args.samplerate / freq)
if freq == args.samplerate:
print(f"DIVM2={divm2}, DIVN2={divn2}, FRACN2={fracn2} DIVP2={divp2} => {freq}")
elif error < args.error:
print(f"DIVM2={divm2}, DIVN2={divn2}, FRACN2={fracn2} DIVP2={divp2} => {freq:.5f}, error={error * 100:.5f}%")

0 comments on commit 80c3ce1

Please sign in to comment.