diff --git a/main.cpp b/main.cpp index f1ab8d5..68a428a 100644 --- a/main.cpp +++ b/main.cpp @@ -1827,6 +1827,9 @@ int run(const Config& cfg) { const uint32_t din_value = pending_din.front(); pending_din.pop_front(); + // Keep ADC logical-channel phase aligned even when samples are skipped outside packet windows. + const uint32_t lch = next_lch; + next_lch = (next_lch + 1U) % cfg.channel_count; const bool di1_level = (din_value & kE502Digital1Mask) != 0U; bool di1_changed = false; @@ -1893,9 +1896,6 @@ int run(const Config& cfg) { tty_group_state.clear_step(); } - const uint32_t lch = next_lch; - next_lch = (next_lch + 1U) % cfg.channel_count; - if (!fast_tty_avg_stream_mode && (cfg.di1_mode == Di1Mode::Trace) && ((cfg.channel_count <= 1U) || (lch == 0U))) {