timestamping: docs and naming

master
Robert Jördens 2021-02-02 14:34:48 +01:00
parent e1c87c149f
commit ddbfa9d988
2 changed files with 5 additions and 6 deletions

View File

@ -117,14 +117,14 @@ const APP: () = {
let iir_state = c.resources.iir_state; let iir_state = c.resources.iir_state;
let lockin = c.resources.lockin; let lockin = c.resources.lockin;
let t = c let timestamp = c
.resources .resources
.timestamper .timestamper
.latest_timestamp() .latest_timestamp()
.unwrap_or_else(|t| t) // Ignore timer capture overflows. .unwrap_or_else(|t| t) // Ignore timer capture overflows.
.map(|t| t as i32); .map(|t| t as i32);
let (pll_phase, pll_frequency) = c.resources.pll.update( let (pll_phase, pll_frequency) = c.resources.pll.update(
t, timestamp,
22, // frequency settling time (log2 counter cycles), TODO: expose 22, // frequency settling time (log2 counter cycles), TODO: expose
22, // phase settling time, TODO: expose 22, // phase settling time, TODO: expose
); );

View File

@ -211,12 +211,11 @@ pub fn setup(
// Configure the timer to count at the designed tick rate. We will manually set the // Configure the timer to count at the designed tick rate. We will manually set the
// period below. // period below.
timer5.pause(); timer5.pause();
timer5.reset_counter();
timer5.set_tick_freq(design_parameters::TIMER_FREQUENCY); timer5.set_tick_freq(design_parameters::TIMER_FREQUENCY);
// The timestamp timer must run at exactly a multiple of the sample timer based on the // The timestamp timer runs at the counter cycle period as the sampling timers.
// batch size. To accomodate this, we manually set the prescaler identical to the sample // To accomodate this, we manually set the prescaler identical to the sample
// timer, but use a period that is longer. // timer, but use maximum overflow period.
let mut timer = timers::TimestampTimer::new(timer5); let mut timer = timers::TimestampTimer::new(timer5);
timer.set_period_ticks(u32::MAX); timer.set_period_ticks(u32::MAX);