From 66df439848a57754b47262f87c7b521611327b9b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 23 Oct 2019 18:35:39 +0800 Subject: [PATCH] better naming/config organization --- simple-dmi.json | 4 ++-- src/noptica.rs | 8 ++++---- src/simple-dmi.rs | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/simple-dmi.json b/simple-dmi.json index 77083d5..1847f0b 100644 --- a/simple-dmi.json +++ b/simple-dmi.json @@ -1,11 +1,11 @@ { "sample_command": "glasgow run logic -V 3.3 --pins-d 0,1", "sample_rate": 48e6, - "freq_min": 1.9e6, - "freq_max": 2.1e6, "bit_ref": 0, "bit_meas": 1, + "ref_min": 1.9e6, + "ref_max": 2.1e6, "refpll_ki": 4294967, "refpll_kp": 85899345, diff --git a/src/noptica.rs b/src/noptica.rs index ee20297..f7ba181 100644 --- a/src/noptica.rs +++ b/src/noptica.rs @@ -52,14 +52,14 @@ impl Dpll { } } -pub struct Tracker { +pub struct PositionTracker { last_phase: i64, current_position: i64 } -impl Tracker { - pub fn new() -> Tracker { - Tracker { +impl PositionTracker { + pub fn new() -> PositionTracker { + PositionTracker { last_phase: 0, current_position: 0 } diff --git a/src/simple-dmi.rs b/src/simple-dmi.rs index 940ec9d..c6c66b5 100644 --- a/src/simple-dmi.rs +++ b/src/simple-dmi.rs @@ -15,10 +15,10 @@ mod noptica; struct Config { sample_command: String, sample_rate: f64, - freq_min: f64, - freq_max: f64, bit_ref: u8, bit_meas: u8, + ref_min: f64, + ref_max: f64, refpll_ki: i64, refpll_kp: i64, decimation: u32 @@ -34,16 +34,16 @@ fn read_config_from_file>(path: P) -> Result