fix
This commit is contained in:
30
main.cpp
30
main.cpp
@ -3061,13 +3061,16 @@ int run(const Config& cfg) {
|
|||||||
!tty_do1_pair_state.pending_ch1_di8_high && !di8_level;
|
!tty_do1_pair_state.pending_ch1_di8_high && !di8_level;
|
||||||
|
|
||||||
if (pair_di1_matches && pair_di2_matches) {
|
if (pair_di1_matches && pair_di2_matches) {
|
||||||
if (both_di8_high) {
|
if (!both_di8_high && !both_di8_normal) {
|
||||||
tty_di8_state.add_sample(0U, tty_do1_pair_state.pending_ch1_raw);
|
++packet_di8_mixed; // mixed DI8 pair -- discard
|
||||||
tty_di8_state.add_sample(1U, adc_raw_value);
|
} else {
|
||||||
++packet_di8_samples_accumulated;
|
if (both_di8_high) {
|
||||||
++packet_di8_both_high;
|
++packet_di8_both_high;
|
||||||
} else if (both_di8_normal) {
|
} else {
|
||||||
++packet_di8_both_normal;
|
++packet_di8_both_normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
// DO1 transition detection (ALL non-mixed pairs).
|
||||||
if (!tty_do1_pair_state.run_initialized) {
|
if (!tty_do1_pair_state.run_initialized) {
|
||||||
tty_do1_pair_state.start_run(di1_level);
|
tty_do1_pair_state.start_run(di1_level);
|
||||||
} else if (tty_do1_pair_state.run_di1_high != di1_level) {
|
} else if (tty_do1_pair_state.run_di1_high != di1_level) {
|
||||||
@ -3076,11 +3079,20 @@ int run(const Config& cfg) {
|
|||||||
tty_do1_pair_state.start_run(di1_level);
|
tty_do1_pair_state.start_run(di1_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DI8=HIGH accumulation AFTER transition check so emitted
|
||||||
|
// di8_ref_step belongs to the completed run, not the new one.
|
||||||
|
if (both_di8_high) {
|
||||||
|
tty_di8_state.add_sample(0U, tty_do1_pair_state.pending_ch1_raw);
|
||||||
|
tty_di8_state.add_sample(1U, adc_raw_value);
|
||||||
|
++packet_di8_samples_accumulated;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pair subtraction includes ALL non-mixed pairs (both
|
||||||
|
// DI8=HIGH and DI8=LOW) so DO1 transitions stay visible
|
||||||
|
// even when DO8 and DO1 phases are perfectly aligned.
|
||||||
tty_do1_pair_state.add_pair_sample(di2_level,
|
tty_do1_pair_state.add_pair_sample(di2_level,
|
||||||
tty_do1_pair_state.pending_ch1_raw,
|
tty_do1_pair_state.pending_ch1_raw,
|
||||||
adc_raw_value);
|
adc_raw_value);
|
||||||
} else {
|
|
||||||
++packet_di8_mixed; // mixed DI8 pair -- discard
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,6 @@ exec "$BIN" \
|
|||||||
do1_toggle_per_frame \
|
do1_toggle_per_frame \
|
||||||
do1_pair_subtract_avg \
|
do1_pair_subtract_avg \
|
||||||
do8_freq_ref \
|
do8_freq_ref \
|
||||||
do8_cycle_period:8 \
|
do8_cycle_period:4 \
|
||||||
"tty:${TTY_PATH}" \
|
"tty:${TTY_PATH}" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user