mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 13:51:34 +01:00
fix to allow all clks for pll (totaldiv was float instead of int) (#579)
This commit is contained in:
@@ -274,7 +274,7 @@ int ALTERA_PLL_SetOuputFrequency(int clkIndex, int pllVCOFreqMhz, int value) {
|
||||
clkIndex, value, pllVCOFreqMhz));
|
||||
|
||||
// calculate output frequency
|
||||
float total_div = (float)pllVCOFreqMhz / (float)value;
|
||||
int total_div = (float)pllVCOFreqMhz / (float)value;
|
||||
|
||||
// assume 50% duty cycle
|
||||
uint32_t low_count = total_div / 2;
|
||||
@@ -282,7 +282,7 @@ int ALTERA_PLL_SetOuputFrequency(int clkIndex, int pllVCOFreqMhz, int value) {
|
||||
uint32_t odd_division = 0;
|
||||
|
||||
// odd division
|
||||
if (total_div > (float)(2 * low_count)) {
|
||||
if (total_div > (2 * low_count)) {
|
||||
++high_count;
|
||||
odd_division = 1;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ void ALTERA_PLL_C10_SetOuputClockDivider(int pllIndex, int clkIndex,
|
||||
uint32_t odd_division = 0;
|
||||
|
||||
// odd division
|
||||
if (value > (int)(2 * low_count)) {
|
||||
if (value > (2 * low_count)) {
|
||||
++high_count;
|
||||
odd_division = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user