aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2023-01-29 21:27:13 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2023-01-29 21:27:13 +0100
commitf5ebc4c9794adc540e8d72eeb31cf62dd1d9dbba (patch)
treeaa0cd0fbcf8a83ce8556fdd9499d6e89a3f60dfd /src
parentdd95dcd60cc602ea3b3c15fe7f022aada889fea8 (diff)
downloadfl2k_ampliphase-f5ebc4c9794adc540e8d72eeb31cf62dd1d9dbba.tar.gz
fl2k_ampliphase-f5ebc4c9794adc540e8d72eeb31cf62dd1d9dbba.tar.bz2
fl2k_ampliphase-f5ebc4c9794adc540e8d72eeb31cf62dd1d9dbba.zip
Fix variable i unintentionnally reassigned
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index fc35c58..54f7171 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -89,17 +89,17 @@ impl DDS {
let incr = 1.0f32 / TRIG_TABLE_LEN as f32;
for i in 0..TRIG_TABLE_LEN {
- let i = f32::cos(incr * i as f32 * 2.0 * PI) * 127.0;
- let q = f32::sin(incr * i as f32 * 2.0 * PI) * 127.0;
+ let inphase = f32::cos(incr * i as f32 * 2.0 * PI) * 127.0;
+ let quadrature = f32::sin(incr * i as f32 * 2.0 * PI) * 127.0;
match waveform {
Waveform::Sine => {
- trig_table_inphase.push(f32::round(i) as i8);
- trig_table_quadrature.push(f32::round(q) as i8);
+ trig_table_inphase.push(f32::round(inphase) as i8);
+ trig_table_quadrature.push(f32::round(quadrature) as i8);
}
Waveform::Rect => {
- trig_table_inphase.push(if i >= 0.0 { 127 } else { -127 });
- trig_table_quadrature.push(if q >= 0.0 { 127 } else { -127 });
+ trig_table_inphase.push(if inphase >= 0.0 { 127 } else { -127 });
+ trig_table_quadrature.push(if quadrature >= 0.0 { 127 } else { -127 });
}
}
}