From bf7ff417c77105c110ee1bb200d08760ab25fc0a Mon Sep 17 00:00:00 2001 From: David Freese Date: Sun, 18 Sep 2011 08:17:30 -0500 Subject: [PATCH] CW/RTTY init fault * Modified transmit code for rtty preamble * Added missing stopflag initialization in CW and RTTY modem class --- src/cw_rtty/cw.cxx | 1 + src/cw_rtty/rtty.cxx | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/cw_rtty/cw.cxx b/src/cw_rtty/cw.cxx index fe17c35b..e14f3c35 100644 --- a/src/cw_rtty/cw.cxx +++ b/src/cw_rtty/cw.cxx @@ -95,6 +95,7 @@ void cw::init() rx_init(); use_paren = progdefaults.CW_use_paren; prosigns = progdefaults.CW_prosigns; + stopflag = false; } cw::~cw() { diff --git a/src/cw_rtty/rtty.cxx b/src/cw_rtty/rtty.cxx index 23aa5e66..7197221d 100644 --- a/src/cw_rtty/rtty.cxx +++ b/src/cw_rtty/rtty.cxx @@ -121,6 +121,7 @@ void rtty::init() bool wfrev = wf->Reverse(); bool wfsb = wf->USB(); reverse = wfrev ^ !wfsb; + stopflag = false; if (progdefaults.StartAtSweetSpot) set_freq(progdefaults.RTTYsweetspot); @@ -730,9 +731,10 @@ void rtty::send_char(int c) void rtty::send_idle() { - if (nbits == 5) + if (nbits == 5) { send_char(LETTERS); - else + txmode = LETTERS; + } else send_char(0); } @@ -743,13 +745,13 @@ int rtty::tx_process() int c; if (preamble > 0) { - preamble--; - send_symbol(1); - if (preamble == 0 && nbits == 5) { + for (int i = 0; i < preamble; i++) + send_symbol(1); + if (nbits == 5) { send_char(LETTERS); txmode = LETTERS; } - return 0; + preamble = 0; } c = get_tx_char(); @@ -772,16 +774,15 @@ int rtty::tx_process() return -1; } -// if NOT Baudot - if (nbits != 5) { - send_char(c); - return 0; - } - // send idle character if c == -1 if (c == -1) { send_idle(); - txmode = LETTERS; + return 0; + } + +// if NOT Baudot + if (nbits != 5) { + send_char(c); return 0; }