Updating DDS control

This commit is contained in:
Ryan Summers 2020-11-17 11:28:45 +01:00
parent 72db53ccd0
commit 84167c7f6f
2 changed files with 4 additions and 19 deletions

View File

@ -55,7 +55,7 @@ use heapless::{consts::*, String};
const SAMPLE_FREQUENCY_KHZ: u32 = 500; const SAMPLE_FREQUENCY_KHZ: u32 = 500;
// The desired ADC sample processing buffer size. // The desired ADC sample processing buffer size.
const SAMPLE_BUFFER_SIZE: usize = 1; const SAMPLE_BUFFER_SIZE: usize = 8;
#[link_section = ".sram3.eth"] #[link_section = ".sram3.eth"]
static mut DES_RING: ethernet::DesRing = ethernet::DesRing::new(); static mut DES_RING: ethernet::DesRing = ethernet::DesRing::new();
@ -829,7 +829,7 @@ const APP: () = {
pounder::Channel::Out0.into(), pounder::Channel::Out0.into(),
100_000_000_f32, 100_000_000_f32,
0.0_f32, 0.0_f32,
*adc0 as f32 / 0xFFFF as f32, 1.0_f32,
) )
.unwrap(); .unwrap();
dds_output.lock(|dds_output| { dds_output.lock(|dds_output| {
@ -902,15 +902,7 @@ const APP: () = {
Ok::<server::Status, ()>(state) Ok::<server::Status, ()>(state)
}), }),
"stabilizer/afe0/gain": (|| c.resources.afe0.get_gain()), "stabilizer/afe0/gain": (|| c.resources.afe0.get_gain()),
"stabilizer/afe1/gain": (|| c.resources.afe1.get_gain()), "stabilizer/afe1/gain": (|| c.resources.afe1.get_gain())
"pounder/dds/clock": (|| {
c.resources.pounder.lock(|pounder| {
match pounder {
Some(pounder) => pounder.get_dds_clock_config(),
_ => Err(pounder::Error::Access),
}
})
})
], ],
modifiable_attributes: [ modifiable_attributes: [
@ -936,14 +928,6 @@ const APP: () = {
Ok::<server::IirRequest, ()>(req) Ok::<server::IirRequest, ()>(req)
}) })
}), }),
"pounder/dds/clock": pounder::DdsClockConfig, (|config| {
c.resources.pounder.lock(|pounder| {
match pounder {
Some(pounder) => pounder.configure_dds_clock(config),
_ => Err(pounder::Error::Access),
}
})
}),
"stabilizer/afe0/gain": afe::Gain, (|gain| { "stabilizer/afe0/gain": afe::Gain, (|gain| {
Ok::<(), ()>(c.resources.afe0.set_gain(gain)) Ok::<(), ()>(c.resources.afe0.set_gain(gain))
}), }),

View File

@ -24,6 +24,7 @@ impl DdsOutput {
} }
pub fn update_handler(&mut self) { pub fn update_handler(&mut self) {
self.update_timer.clear_uif_bit();
match self.profiles.dequeue() { match self.profiles.dequeue() {
Some(profile) => self.write_profile(profile), Some(profile) => self.write_profile(profile),
None => self.update_timer.pause(), None => self.update_timer.pause(),