diff --git a/main.c b/main.c index 2d4b40d..cebf470 100644 --- a/main.c +++ b/main.c @@ -956,7 +956,7 @@ config_t config = { ._xtal_freq = XTALFREQ, ._measure_r = MEASURE_DEFAULT_R, ._lever_mode = LM_MARKER, - ._band_mode = 0, + ._band_mode = BOARD_CLOCK_GEN, }; properties_t current_props; diff --git a/si5351.h b/si5351.h index 8758d35..207bdf4 100644 --- a/si5351.h +++ b/si5351.h @@ -19,6 +19,15 @@ * Boston, MA 02110-1301, USA. */ +// Define the two hardware clock generator models +#define SI5351_CLOCK_GEN 0 +#define MS5351_CLOCK_GEN 1 + +// Make the Si5351 generator the default +#ifndef BOARD_CLOCK_GEN +#define BOARD_CLOCK_GEN SI5351_CLOCK_GEN +#endif + #define SI5351_REG_3_OUTPUT_ENABLE_CONTROL 3 #define SI5351_CLK0_EN (1<<0) #define SI5351_CLK1_EN (1<<1) diff --git a/ui.c b/ui.c index 44b6e73..5dd1830 100644 --- a/ui.c +++ b/ui.c @@ -1542,10 +1542,10 @@ static UI_FUNCTION_ADV_CALLBACK(menu_band_sel_acb) { (void)data; if (b){ - b->p1.text = config._band_mode == 0 ? "Si5351" : "MS5351"; + b->p1.text = config._band_mode == SI5351_CLOCK_GEN ? "Si5351" : "MS5351"; return; } - config._band_mode = config._band_mode == 0 ? 1 : 0; + config._band_mode = config._band_mode == SI5351_CLOCK_GEN ? MS5351_CLOCK_GEN : SI5351_CLOCK_GEN; si5351_set_band_mode(config._band_mode); }