diff --git a/main.cpp b/main.cpp index 74d3ced..8227939 100644 --- a/main.cpp +++ b/main.cpp @@ -508,7 +508,8 @@ void print_help(const char* exe_name) { << " di1_group_avg -> with tty + di1:trace, emit one averaged 4-word step per constant DI1 run\n" << " do1_toggle_per_frame -> DI_SYN2 level-gated DO1 modulation:\n" << " DO1 is forced LOW when DI_SYN2 is LOW,\n" - << " while DI_SYN2 is HIGH DO1 toggles every 3 complete CH1+CH2 frames\n" + << " while DI_SYN2 is HIGH on the full frame (CH1 and CH2 ticks),\n" + << " DO1 toggles every 3 complete CH1+CH2 frames\n" << " tty+di1_group_avg -> fast stream-only mode: skip CSV/SVG/live outputs and send only averaged tty data\n" << " If sample_clock_hz is omitted together with clock:internal, the maximum ADC speed is used\n" << "\n" @@ -1589,6 +1590,7 @@ int run(const Config& cfg) { bool do1_output_high = false; bool do1_gate_active = false; uint32_t do1_frames_since_toggle = 0; + bool do1_frame_all_high = true; uint64_t do1_packet_toggle_count = 0; uint64_t do1_packet_queued_words = 0; uint64_t do1_packet_sent_words_baseline = 0; @@ -1793,6 +1795,7 @@ int run(const Config& cfg) { } else { do1_output_high = do1_high; } + flush_dout_queue(0U, false); }; auto do1_on_packet_start = [&]() { @@ -2222,8 +2225,10 @@ int run(const Config& cfg) { } const bool frame_complete = (lch == (cfg.channel_count - 1U)); if (cfg.do1_toggle_per_frame) { + do1_frame_all_high = do1_frame_all_high && di_syn2_level; if (frame_complete) { - do1_on_frame_complete(di_syn2_level); + do1_on_frame_complete(do1_frame_all_high); + do1_frame_all_high = true; } }