From b3170f0cdb1b3b2ff13225f583041dc678250a37 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 6 Jun 2021 18:13:54 +0200 Subject: Improve USB handling and send switch messages --- sw/eval-clock-cw-tx/src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sw/eval-clock-cw-tx/src/main.rs') diff --git a/sw/eval-clock-cw-tx/src/main.rs b/sw/eval-clock-cw-tx/src/main.rs index 716d184..2dce7bc 100644 --- a/sw/eval-clock-cw-tx/src/main.rs +++ b/sw/eval-clock-cw-tx/src/main.rs @@ -197,7 +197,7 @@ fn main() -> ! { ui, cw_pwm, cw_keyer : cw::Keyer::new(12, TICKS_PER_SECOND), - cw_paddle_tip, cw_paddle_ring, ptt_out, seq_switch, led + cw_paddle_tip, cw_paddle_ring, ptt_out, seq_switch, led, }; si_clock::SiClock::new(i2c_busmanager.acquire_i2c(), 0, shared.state.vfo_display()) @@ -264,6 +264,12 @@ fn main() -> ! { update_disp_required = true; } + match (previous_state.clone(), state.sequence_state.clone()) { + (SequenceState::Rx, SequenceState::Switching(_)) => usb.send_transmit(), + (SequenceState::Switching(_), SequenceState::Rx) => usb.send_receive(), + _ => (), + } + let vfo = state.vfo_display(); if previous_vfo != vfo || previous_state != state.sequence_state { siclock.set_vfo(state.vfo_siclock()); -- cgit v1.2.3