etherkit / Si5351Arduino

Library for the Si5351 clock generator IC in the Arduino environment
GNU General Public License v3.0
245 stars 98 forks source link

Repeated definition for output clock divide by 64 in function select_r_div #88

Closed hwstar closed 2 years ago

hwstar commented 2 years ago

In the function select_r_div, I have a question about lines 1731 through 1735. The else-if blocks are are exactly the same and are redundant. See this snippet below. Is this intentional or is it a mistake?

uint8_t Si5351::select_r_div(uint64_t *freq) { . . .

Line 1731

else if((*freq >= SI5351_CLKOUT_MIN_FREQ * SI5351_FREQ_MULT * 2) && (*freq < SI5351_CLKOUT_MIN_FREQ * SI5351_FREQ_MULT * 4))
{
    r_div = SI5351_OUTPUT_CLK_DIV_64;
    *freq *= 64ULL;
}
else if((*freq >= SI5351_CLKOUT_MIN_FREQ * SI5351_FREQ_MULT * 2) && (*freq < SI5351_CLKOUT_MIN_FREQ * SI5351_FREQ_MULT * 4))
{
    r_div = SI5351_OUTPUT_CLK_DIV_64;
    *freq *= 64ULL;
}

. . . }

hwstar commented 2 years ago

Updated error and resubmitted as new issue