Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to get CW sending working again #83

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions protocol1.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ static gpointer receive_thread(gpointer arg) {
static void process_control_bytes() {
gboolean previous_ptt;
// Unused - commented in case used in future
//gboolean previous_dot;
//gboolean previous_dash;
gboolean previous_dot;
gboolean previous_dash;

gint tx_mode=USB;

Expand All @@ -460,22 +460,20 @@ static void process_control_bytes() {
}

previous_ptt=radio->local_ptt;
//previous_dot=radio->dot;
//previous_dash=radio->dash;
radio->ptt=(control_in[0]&0x01)==0x01;
//radio->dash=(control_in[0]&0x02)==0x02;
//radio->dot=(control_in[0]&0x04)==0x04;

radio->local_ptt=radio->ptt;
if(tx_mode==CWL || tx_mode==CWU) {
radio->local_ptt=radio->ptt|radio->dot|radio->dash;
previous_dot=radio->dot;
previous_dash=radio->dash;
radio->ptt = (control_in[0] & 0x01)==0x01;
radio->dash = (control_in[0] & 0x02)==0x02;
radio->dot = (control_in[0] & 0x04)==0x04;

radio->local_ptt = radio->ptt;
if(tx_mode == CWL || tx_mode == CWU) {
radio->local_ptt = radio->ptt | radio->dot | radio->dash;
}
if(previous_ptt!=radio->local_ptt) {
g_print("process_control_bytes: ppt=%d dot=%d dash=%d\n",radio->ptt,radio->dot,radio->dash);
g_idle_add(ext_ptt_changed,(gpointer)radio);
g_print("process_control_bytes: ppt=%d dot=%d dash=%d\n",radio->ptt,radio->dot,radio->dash);
g_idle_add(ext_ptt_changed,(gpointer)radio);
}



switch((control_in[0]>>3)&0x1F) {
case 0:
Expand Down Expand Up @@ -718,10 +716,11 @@ static void process_ozy_input_buffer(char *buffer) {

radio->local_ptt=radio->ptt;
if(tx_mode==CWL || tx_mode==CWU) {
radio->local_ptt=radio->ptt|radio->dot|radio->dash;
radio->local_ptt = radio->ptt | radio->dot | radio->dash;
}

if(previous_ptt!=radio->local_ptt) {
//g_idle_add(ext_ptt_update,(gpointer)(long)(radio->local_ptt));
g_idle_add(ext_ptt_update,(gpointer)(long)(radio->local_ptt));
}

switch((control_in[0]>>3)&0x1F) {
Expand Down Expand Up @@ -1520,16 +1519,17 @@ void ozy_send_buffer() {
}
}

output_buffer[C1]=0x00;
if(tx_mode!=CWU && tx_mode!=CWL) {
// output_buffer[C1]|=0x00;
} else {
if(radio->tune || radio->vox || !radio->cw_keyer_internal || !radio->cwdaemon) {
output_buffer[C1]|=0x00;
} else {
output_buffer[C1]|=0x01;
}
/* sidetone enable */
output_buffer[C1] = 0x00;
if ((tx_mode == CWL) || (tx_mode == CWU)
&& !radio->tune
&& radio->cw_keyer_internal
&& !radio->cwdaemon)
{
output_buffer[C1] = 0x01;
}

/* sidetone volume */
output_buffer[C2]=radio->cw_keyer_sidetone_volume;

//CWX enable/disable
Expand Down
6 changes: 3 additions & 3 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,11 +1103,11 @@ g_print("create_radio for %s %d\n",d->name,d->device);
r->classE=FALSE;

r->cw_keyer_internal=TRUE;
r->cw_keyer_sidetone_frequency=650;
r->cw_keyer_sidetone_frequency=700;
r->cw_keyer_sidetone_volume=20;
r->cw_keyer_speed=12;
r->cw_keyer_speed=20;
r->cw_keyer_mode=KEYER_STRAIGHT;
r->cw_keyer_weight=30;
r->cw_keyer_weight=40;
r->cw_keyer_spacing=0;
r->cw_keyer_ptt_delay=20;
r->cw_keyer_hang_time=300;
Expand Down