lockin-external: use enum
This commit is contained in:
parent
f050ba8e9f
commit
c0457787bb
@ -125,12 +125,19 @@ const APP: () = {
|
|||||||
.last()
|
.last()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let conf = "frequency_discriminator";
|
#[allow(dead_code)]
|
||||||
|
enum Conf {
|
||||||
|
PowerPhase,
|
||||||
|
FrequencyDiscriminator,
|
||||||
|
Quadrature,
|
||||||
|
}
|
||||||
|
|
||||||
|
let conf = Conf::FrequencyDiscriminator; // TODO: expose
|
||||||
let output = match conf {
|
let output = match conf {
|
||||||
// Convert from IQ to power and phase.
|
// Convert from IQ to power and phase.
|
||||||
"power_phase" => [(output.log2() << 24) as _, output.arg()],
|
Conf::PowerPhase => [(output.log2() << 24) as _, output.arg()],
|
||||||
"frequency_discriminator" => [pll_frequency as _, output.arg()],
|
Conf::FrequencyDiscriminator => [pll_frequency as _, output.arg()],
|
||||||
_ => [output.re, output.im],
|
Conf::Quadrature => [output.re, output.im],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert to DAC data.
|
// Convert to DAC data.
|
||||||
|
Loading…
Reference in New Issue
Block a user