Merge pull request #269 from quartiq/rj/misc
fix hal branch, cleanup code
This commit is contained in:
commit
fcf59be684
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1013,7 +1013,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "stm32h7xx-hal"
|
||||
version = "0.8.0"
|
||||
source = "git+https://github.com/stm32-rs/stm32h7xx-hal?branch=dma#2b8a04caac566a8560f400ddd6503508f78bea77"
|
||||
source = "git+https://github.com/stm32-rs/stm32h7xx-hal?branch=master#2b8a04caac566a8560f400ddd6503508f78bea77"
|
||||
dependencies = [
|
||||
"bare-metal 1.0.0",
|
||||
"cast",
|
||||
|
@ -57,7 +57,7 @@ default-features = false
|
||||
[dependencies.stm32h7xx-hal]
|
||||
features = ["stm32h743v", "rt", "unproven", "ethernet", "quadspi"]
|
||||
git = "https://github.com/stm32-rs/stm32h7xx-hal"
|
||||
branch = "dma"
|
||||
branch = "master"
|
||||
|
||||
[features]
|
||||
semihosting = ["panic-semihosting", "cortex-m-log/semihosting"]
|
||||
|
@ -7,14 +7,6 @@ pub struct Lockin {
|
||||
}
|
||||
|
||||
impl Lockin {
|
||||
/// Create a new Lockin with given IIR coefficients.
|
||||
pub fn new() -> Self {
|
||||
let lp = Lowpass::default();
|
||||
Self {
|
||||
state: [lp.clone(), lp],
|
||||
}
|
||||
}
|
||||
|
||||
/// Update the lockin with a sample taken at a given phase.
|
||||
/// The lowpass has a gain of `1 << k`.
|
||||
pub fn update(&mut self, sample: i16, phase: i32, k: u8) -> Complex<i32> {
|
||||
|
@ -34,8 +34,6 @@ const APP: () = {
|
||||
+ design_parameters::SAMPLE_BUFFER_SIZE_LOG2,
|
||||
);
|
||||
|
||||
let lockin = Lockin::new();
|
||||
|
||||
// Enable ADC/DAC events
|
||||
stabilizer.adcs.0.start();
|
||||
stabilizer.adcs.1.start();
|
||||
@ -59,7 +57,7 @@ const APP: () = {
|
||||
timestamper: stabilizer.timestamper,
|
||||
|
||||
pll,
|
||||
lockin,
|
||||
lockin: Lockin::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +104,8 @@ const APP: () = {
|
||||
let time_constant: u8 = 6; // TODO: expose
|
||||
|
||||
let sample_frequency = ((pll_frequency
|
||||
// .wrapping_add(1 << design_parameters::SAMPLE_BUFFER_SIZE_LOG2 - 1) // half-up rounding bias
|
||||
// half-up rounding bias
|
||||
// .wrapping_add(1 << design_parameters::SAMPLE_BUFFER_SIZE_LOG2 - 1)
|
||||
>> design_parameters::SAMPLE_BUFFER_SIZE_LOG2)
|
||||
as i32)
|
||||
.wrapping_mul(harmonic);
|
||||
|
@ -28,8 +28,6 @@ const APP: () = {
|
||||
// Configure the microcontroller
|
||||
let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device);
|
||||
|
||||
let lockin = Lockin::new();
|
||||
|
||||
// Enable ADC/DAC events
|
||||
stabilizer.adcs.1.start();
|
||||
stabilizer.dacs.0.start();
|
||||
@ -39,7 +37,7 @@ const APP: () = {
|
||||
stabilizer.adc_dac_timer.start();
|
||||
|
||||
init::LateResources {
|
||||
lockin,
|
||||
lockin: Lockin::default(),
|
||||
afes: stabilizer.afes,
|
||||
adc: stabilizer.adcs.1,
|
||||
dacs: stabilizer.dacs,
|
||||
|
Loading…
Reference in New Issue
Block a user