aboutsummaryrefslogtreecommitdiffstats
path: root/sw/eval-clock-cw-tx/src/main.rs
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-06-06 18:13:54 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-06-06 18:13:54 +0200
commitb3170f0cdb1b3b2ff13225f583041dc678250a37 (patch)
tree168b60659cc7465ac1b6841c5eddaf2b519523af /sw/eval-clock-cw-tx/src/main.rs
parent1ee6040a847d386afc7d7e64945c3a5ff87aa6d7 (diff)
downloadpicardy-b3170f0cdb1b3b2ff13225f583041dc678250a37.tar.gz
picardy-b3170f0cdb1b3b2ff13225f583041dc678250a37.tar.bz2
picardy-b3170f0cdb1b3b2ff13225f583041dc678250a37.zip
Improve USB handling and send switch messages
Diffstat (limited to 'sw/eval-clock-cw-tx/src/main.rs')
-rw-r--r--sw/eval-clock-cw-tx/src/main.rs8
1 files changed, 7 insertions, 1 deletions
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());