From 28b1b3662eae56ed91487d21df9967d914fca580 Mon Sep 17 00:00:00 2001
From: Stephen D <webmaster@scd31.com>
Date: Mon, 14 Oct 2024 16:49:48 -0300
Subject: [PATCH] move frequency into a constant

---
 src/main.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index d6075a1..8d87082 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -28,6 +28,8 @@ mod app {
     use crate::packet::PACKET_LEN;
     use crate::spi_data::{self, SpiData};
 
+    const FREQUENCY_HZ: u32 = 446_900_000;
+
     // in # packets
     const BUFFER_LEN: usize = 100;
 
@@ -147,7 +149,7 @@ mod app {
 
         let delay = ctx.device.TIM5.delay_us(&clocks);
         let mut radio = Rf4463::new(spi, sdn, cs, delay, &mut RADIO_CONFIG_500_2.clone()).unwrap();
-        radio.set_frequency(446_900_000).unwrap();
+        radio.set_frequency(FREQUENCY_HZ).unwrap();
 
         radio_irq.make_interrupt_source(&mut sys_cfg);
         radio_irq.enable_interrupt(&mut ctx.device.EXTI);
-- 
GitLab