From 55822dadf7c321a5007e9eef8dd4dc932dc634df Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Sun, 26 Apr 2020 23:46:32 -0700 Subject: [PATCH] Give min/max frequency variable names --- si5351.cpp | 3 ++- si5351.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/si5351.cpp b/si5351.cpp index ec4879b..d42687d 100644 --- a/si5351.cpp +++ b/si5351.cpp @@ -1,6 +1,7 @@ #include #include #include "settings.h" +#include "si5351.h" // ************* SI5315 routines - tks Jerry Gaffke, KE7ER *********************** @@ -84,7 +85,7 @@ void si5351bx_init() { // Call once at power-up, start PLLA void si5351bx_setfreq(uint8_t clknum, uint32_t fout) { // Set a CLK to fout Hz uint32_t msa, msb, msc, msxp1, msxp2, msxp3p2top; - if ((fout < 500000) || (fout > 109000000)) // If clock freq out of range + if ((fout < SI5351_MIN_FREQUENCY_HZ) || (fout > SI5351_MAX_FREQUENCY_HZ)) // If clock freq out of range si5351bx_clken |= 1 << clknum; // shut down the clock else { msa = si5351bx_vcoa / fout; // Integer part of vco/fout diff --git a/si5351.h b/si5351.h index 2a9d38e..f2afc85 100644 --- a/si5351.h +++ b/si5351.h @@ -1,5 +1,10 @@ #pragma once +#include + +static const uint32_t SI5351_MIN_FREQUENCY_HZ = 500000; +static const uint32_t SI5351_MAX_FREQUENCY_HZ = 109000000; + void initOscillators(); void si5351bx_setfreq(uint8_t clknum, uint32_t fout); void si5351_set_calibration(int32_t cal); //calibration is a small value that is nudged to make up for the inaccuracies of the reference 25 MHz crystal frequency