From: John Melton - G0ORX/N6LYT Date: Fri, 9 Dec 2016 12:06:20 +0000 (+0000) Subject: Added frequency entry. Start of diversity ... X-Git-Url: https://git.rkrishnan.org/uri/vdrive/%3C?a=commitdiff_plain;h=0eccfd21a4fe25f8cee75372b01e765b95d8d19e;p=pihpsdr.git Added frequency entry. Start of diversity ... --- diff --git a/Makefile b/Makefile index 009dbd1..96b582e 100644 --- a/Makefile +++ b/Makefile @@ -144,6 +144,8 @@ noise_menu.c \ agc_menu.c \ fm_menu.c \ vox_menu.c \ +diversity_menu.c \ +freqent_menu.c \ test_menu.c \ rit.c \ meter.c \ @@ -202,6 +204,8 @@ noise_menu.h \ agc_menu.h \ fm_menu.h \ vox_menu.h \ +diversity_menu.h \ +freqent_menu.h \ test_menu.h \ rit.h \ meter.h \ @@ -257,6 +261,8 @@ noise_menu.o \ agc_menu.o \ fm_menu.o \ vox_menu.o \ +diversity_menu.o \ +freqent_menu.o \ test_menu.o \ rit.o \ meter.o \ diff --git a/band.c b/band.c index 1ee209e..980d94f 100644 --- a/band.c +++ b/band.c @@ -535,3 +535,17 @@ fprintf(stderr,"bandRestoreState: restore bands\n"); if(value) band=atoi(value); } +int get_band_from_frequency(long long f) { + int b; + int found=-1; + for(b=0;btitle)>0) { + if(f>=band->frequencyMin && f<=band->frequencyMax) { + found=b; + break; + } + } + } + return found; +} diff --git a/band.h b/band.h index 6a25488..5f99de7 100644 --- a/band.h +++ b/band.h @@ -87,6 +87,7 @@ int band_get_current(); BAND *band_get_current_band(); BAND *band_get_band(int b); BAND *band_set_current(int b); +int get_band_from_frequency(long long f); BANDSTACK_ENTRY *bandstack_entry_next(); BANDSTACK_ENTRY *bandstack_entry_previous(); diff --git a/diversity_menu.c b/diversity_menu.c new file mode 100644 index 0000000..009a206 --- /dev/null +++ b/diversity_menu.c @@ -0,0 +1,128 @@ +/* Copyright (C) +* 2016 - John Melton, G0ORX/N6LYT +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +*/ + +#include +#include +#include +#include +#include + +#include "new_menu.h" +#include "diversity_menu.h" +#include "radio.h" +#include + +static GtkWidget *parent_window=NULL; + +static GtkWidget *dialog=NULL; + +static GtkWidget *level; + +static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { + if(dialog!=NULL) { + gtk_widget_destroy(dialog); + dialog=NULL; + sub_menu=NULL; + } + return TRUE; +} + +static void diversity_cb(GtkWidget *widget, gpointer data) { + diversity_enabled=diversity_enabled==1?0:1; + SetEXTDIVRun(0,diversity_enabled); +} + +static void i_rotate_value_changed_cb(GtkWidget *widget, gpointer data) { + i_rotate[1]=gtk_range_get_value(GTK_RANGE(widget)); + SetEXTDIVRotate (0, 2, &i_rotate, &q_rotate); +} + +static void q_rotate_value_changed_cb(GtkWidget *widget, gpointer data) { + q_rotate[1]=gtk_range_get_value(GTK_RANGE(widget)); + SetEXTDIVRotate (0, 2, &i_rotate, &q_rotate); +} + +void diversity_menu(GtkWidget *parent) { + int i; + + parent_window=parent; + + dialog=gtk_dialog_new(); + gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window)); + gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE); + + GdkRGBA color; + color.red = 1.0; + color.green = 1.0; + color.blue = 1.0; + color.alpha = 1.0; + gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color); + + GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog)); + + GtkWidget *grid=gtk_grid_new(); + gtk_grid_set_column_spacing (GTK_GRID(grid),10); + gtk_grid_set_row_spacing (GTK_GRID(grid),10); + //gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE); + //gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE); + + GtkWidget *close_b=gtk_button_new_with_label("Close Diversity"); + g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL); + gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1); + + GtkWidget *diversity_b=gtk_check_button_new_with_label("Diversity Enable"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (diversity_b), diversity_enabled); + gtk_widget_show(diversity_b); + gtk_grid_attach(GTK_GRID(grid),diversity_b,0,1,1,1); + g_signal_connect(diversity_b,"toggled",G_CALLBACK(diversity_cb),NULL); + + + GtkWidget *i_rotate_label=gtk_label_new("I Rotate:"); + gtk_misc_set_alignment (GTK_MISC(i_rotate_label), 0, 0); + gtk_widget_show(i_rotate_label); + gtk_grid_attach(GTK_GRID(grid),i_rotate_label,0,2,1,1); + + GtkWidget *i_rotate_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0,1.0,0.01); + gtk_widget_set_size_request (i_rotate_scale, 300, 25); + gtk_range_set_value(GTK_RANGE(i_rotate_scale),i_rotate[1]); + gtk_widget_show(i_rotate_scale); + gtk_grid_attach(GTK_GRID(grid),i_rotate_scale,1,2,1,1); + g_signal_connect(G_OBJECT(i_rotate_scale),"value_changed",G_CALLBACK(i_rotate_value_changed_cb),NULL); + + GtkWidget *q_rotate_label=gtk_label_new("Q Rotate:"); + gtk_misc_set_alignment (GTK_MISC(q_rotate_label), 0, 0); + gtk_widget_show(q_rotate_label); + gtk_grid_attach(GTK_GRID(grid),q_rotate_label,0,3,1,1); + + GtkWidget *q_rotate_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0,1.0,0.01); + gtk_widget_set_size_request (q_rotate_scale, 300, 25); + gtk_range_set_value(GTK_RANGE(q_rotate_scale),q_rotate[1]); + gtk_widget_show(q_rotate_scale); + gtk_grid_attach(GTK_GRID(grid),q_rotate_scale,1,3,1,1); + g_signal_connect(G_OBJECT(q_rotate_scale),"value_changed",G_CALLBACK(q_rotate_value_changed_cb),NULL); + + + gtk_container_add(GTK_CONTAINER(content),grid); + + sub_menu=dialog; + + gtk_widget_show_all(dialog); + +} + diff --git a/diversity_menu.h b/diversity_menu.h new file mode 100644 index 0000000..2530dae --- /dev/null +++ b/diversity_menu.h @@ -0,0 +1,20 @@ +/* Copyright (C) +* 2016 - John Melton, G0ORX/N6LYT +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +*/ + +extern void diversity_menu(GtkWidget *parent); diff --git a/freqent_menu.c b/freqent_menu.c new file mode 100644 index 0000000..739b883 --- /dev/null +++ b/freqent_menu.c @@ -0,0 +1,191 @@ +/* Copyright (C) +* 2016 - John Melton, G0ORX/N6LYT +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +*/ + +#include +#include +#include +#include + +#include "new_menu.h" +#include "band.h" +#include "filter.h" +#include "mode.h" +#include "radio.h" +#include "vfo.h" + +static GtkWidget *parent_window=NULL; +static GtkWidget *dialog=NULL; +static GtkWidget *label; + +#define BUF_SIZE 88 + +static char *btn_labels[] = {"1","2","3","4", + "5","6","7","8", + "9","0",".","BS", + "HZ","KZ","MZ","CR" + }; + +static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { + if(dialog!=NULL) { + gtk_widget_destroy(dialog); + dialog=NULL; + sub_menu=NULL; + } + return TRUE; +} + +static gboolean freqent_select_cb (GtkWidget *widget, gpointer data) { + char *str = (char *) data; + const char *labelText; + char output[BUF_SIZE], buffer[BUF_SIZE]; + int len; + double mult; + long long f; + static int set = 0; + + if (set) { + set = 0; + strcpy (buffer, "0"); + sprintf(output, "%s", buffer); + gtk_label_set_markup (GTK_LABEL (label), output); + len = 1; + } else { + labelText = gtk_label_get_text (GTK_LABEL (label)); + strcpy (buffer, labelText); + len = strlen (buffer); + } + + if (isdigit (str[0]) || str[0] == '.') { + + buffer[len] = (gchar) str[0]; + buffer[len+1] = (gchar) 0; + + len = (buffer[0] == '0') ? 1 : 0; + + sprintf(output, "%s", buffer+len); + gtk_label_set_markup (GTK_LABEL (label), output); + } else { + + if (strcmp (str, "BS") == 0) { + /* --- Remove the last character on it. --- */ + if (len > 0) buffer[len-1] = (gchar) 0; + + /* --- Remove digit from field. --- */ + sprintf(output, "%s", buffer); + gtk_label_set_markup (GTK_LABEL (label), output); + + /* --- clear? --- */ + } else if (strcmp (str, "CR") == 0) { + strcpy (buffer, "0"); + sprintf(output, "%s", buffer); + gtk_label_set_markup (GTK_LABEL (label), buffer); + } else if (str[1] == 'Z') { + switch(str[0]) { + case 'M': + mult = 10000000.0; + break; + case 'K': + mult = 10000.0; + break; + default : + mult = 10.0; + } + //f = (long long)atof(buffer)*mult; + f = ((long long)(atof(buffer)*mult)+5)/10; +fprintf(stderr, "BUFFER=%s\n", buffer); + sprintf(output, "%lld", f); + gtk_label_set_markup (GTK_LABEL (label), output); + int b=get_band_from_frequency(f); + if(b<0) { + fprintf(stderr,"get_band_from_frequency: failed for f=%lld\n",f); + b=bandGen; + } + if(b!=band_get_current()) { + BAND *band=band_set_current(b); + BANDSTACK_ENTRY *entry=bandstack_entry_get_current(); + setMode(entry->mode); + FILTER* band_filters=filters[entry->mode]; + FILTER* band_filter=&band_filters[entry->filter]; + setFilter(band_filter->low,band_filter->high); + set_alex_rx_antenna(band->alexRxAntenna); + set_alex_tx_antenna(band->alexTxAntenna); + set_alex_attenuation(band->alexAttenuation); + + } + setFrequency(f); + vfo_update(NULL); + + set = 1; + } + } + vfo_update(NULL); +} + +static GtkWidget *last_mode; + +void freqent_menu(GtkWidget *parent) { + int i; + + parent_window=parent; + + dialog=gtk_dialog_new(); + gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window)); + gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE); + + GdkRGBA color; + color.red = 1.0; + color.green = 1.0; + color.blue = 1.0; + color.alpha = 1.0; + gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color); + + GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog)); + + GtkWidget *grid=gtk_grid_new(); + + gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE); + gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE); + gtk_grid_set_column_spacing (GTK_GRID(grid),4); + gtk_grid_set_row_spacing (GTK_GRID(grid),4); + + GtkWidget *close_b=gtk_button_new_with_label("Close FreqEntry"); + g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL); + gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1); + + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), "0"); + gtk_misc_set_alignment (GTK_MISC (label), 1, .5); + gtk_grid_attach(GTK_GRID(grid),label,1,0,1,1); + + GtkWidget *step_rb=NULL; + for (i=0; i<16; i++) { + GtkWidget *b=gtk_button_new_with_label(btn_labels[i]); + set_button_text_color(b,"black"); + gtk_widget_show(b); + gtk_grid_attach(GTK_GRID(grid),b,i%4,1+(i/4),1,1); + g_signal_connect(b,"pressed",G_CALLBACK(freqent_select_cb),(gpointer *)btn_labels[i]); + } + + gtk_container_add(GTK_CONTAINER(content),grid); + + sub_menu=dialog; + + gtk_widget_show_all(dialog); + +} diff --git a/freqent_menu.h b/freqent_menu.h new file mode 100644 index 0000000..5edc998 --- /dev/null +++ b/freqent_menu.h @@ -0,0 +1,20 @@ +/* Copyright (C) +* 2016 - John Melton, G0ORX/N6LYT +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +* +*/ + +extern void freqent_menu(GtkWidget *parent); diff --git a/new_menu.c b/new_menu.c index f85ada9..dc65b2a 100644 --- a/new_menu.c +++ b/new_menu.c @@ -49,6 +49,8 @@ #include "fm_menu.h" #include "test_menu.h" #include "vox_menu.h" +#include "diversity_menu.h" +#include "freqent_menu.h" static GtkWidget *parent_window=NULL; @@ -250,6 +252,26 @@ static gboolean vox_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) return TRUE; } +void start_diversity() { + cleanup(); + diversity_menu(parent_window); +} + +static gboolean diversity_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { + start_diversity(); + return TRUE; +} + +void start_freqent() { + cleanup(); + freqent_menu(parent_window); +} + +static gboolean freqent_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { + start_freqent(); + return TRUE; +} + void start_test() { cleanup(); test_menu(parent_window); @@ -363,6 +385,14 @@ static gboolean new_menu_pressed_event_cb (GtkWidget *widget, g_signal_connect (vox_b, "button-press-event", G_CALLBACK(vox_cb), NULL); gtk_grid_attach(GTK_GRID(grid),vox_b,2,3,1,1); + GtkWidget *diversity_b=gtk_button_new_with_label("Diversity"); + g_signal_connect (diversity_b, "button-press-event", G_CALLBACK(diversity_cb), NULL); + gtk_grid_attach(GTK_GRID(grid),diversity_b,3,3,1,1); + + GtkWidget *frequency_b=gtk_button_new_with_label("Frequency"); + g_signal_connect (frequency_b, "button-press-event", G_CALLBACK(freqent_cb), NULL); + gtk_grid_attach(GTK_GRID(grid),frequency_b,4,3,1,1); + GtkWidget *band_b=gtk_button_new_with_label("Band"); g_signal_connect (band_b, "button-press-event", G_CALLBACK(band_cb), NULL); gtk_grid_attach(GTK_GRID(grid),band_b,0,4,1,1); diff --git a/new_protocol.c b/new_protocol.c index 2feb7f2..867444f 100644 --- a/new_protocol.c +++ b/new_protocol.c @@ -752,10 +752,14 @@ fprintf(stderr,"outputsamples=%d\n", outputsamples); switch(sourceport) { case RX_IQ_TO_HOST_PORT_0: - process_iq_data(0,buffer); - break; case RX_IQ_TO_HOST_PORT_1: - process_iq_data(1,buffer); + case RX_IQ_TO_HOST_PORT_2: + case RX_IQ_TO_HOST_PORT_3: + case RX_IQ_TO_HOST_PORT_4: + case RX_IQ_TO_HOST_PORT_5: + case RX_IQ_TO_HOST_PORT_6: + case RX_IQ_TO_HOST_PORT_7: + process_iq_data(sourceport-RX_IQ_TO_HOST_PORT_0,buffer); break; case COMMAND_RESPONCE_TO_HOST_PORT: process_command_response(buffer); @@ -804,6 +808,8 @@ static void process_iq_data(int rx,unsigned char *buffer) { double leftsampledouble; double rightsampledouble; +fprintf(stderr,"process_iq_data: %d\n",rx); + sequence=((buffer[0]&0xFF)<<24)+((buffer[1]&0xFF)<<16)+((buffer[2]&0xFF)<<8)+(buffer[3]&0xFF); timestamp=((long long)(buffer[4]&0xFF)<<56)+((long long)(buffer[5]&0xFF)<<48)+((long long)(buffer[6]&0xFF)<<40)+((long long)(buffer[7]&0xFF)<<32); ((long long)(buffer[8]&0xFF)<<24)+((long long)(buffer[9]&0xFF)<<16)+((long long)(buffer[10]&0xFF)<<8)+(long long)(buffer[11]&0xFF); @@ -1057,11 +1063,14 @@ static void full_rx_buffer(int rx) { int j; int error; -if(rx==0) { - fexchange0(CHANNEL_RX0, iqinputbuffer[rx], audiooutputbuffer, &error); - if(error!=0) { - fprintf(stderr,"full_rx_buffer: fexchange0: error=%d\n",error); - } + Spectrum0(1, CHANNEL_RX0, 0, 0, iqinputbuffer[rx]); + + if(rx==active_receiver) { + fexchange0(CHANNEL_RX0, iqinputbuffer[rx], audiooutputbuffer, &error); + if(error!=0) { + fprintf(stderr,"full_rx_buffer: fexchange0: error=%d\n",error); + } +/* switch(mode) { #ifdef PSK case modePSK: @@ -1071,7 +1080,7 @@ if(rx==0) { Spectrum0(1, CHANNEL_RX0, 0, 0, iqinputbuffer[rx]); break; } - +*/ switch(mode) { #ifdef FREEDV case modeFREEDV: diff --git a/new_protocol.h b/new_protocol.h index 2f3e096..ed62293 100644 --- a/new_protocol.h +++ b/new_protocol.h @@ -38,6 +38,10 @@ #define RX_IQ_TO_HOST_PORT_1 1036 #define RX_IQ_TO_HOST_PORT_2 1037 #define RX_IQ_TO_HOST_PORT_3 1038 +#define RX_IQ_TO_HOST_PORT_4 1039 +#define RX_IQ_TO_HOST_PORT_5 1040 +#define RX_IQ_TO_HOST_PORT_6 1041 +#define RX_IQ_TO_HOST_PORT_7 1042 #define BUFFER_SIZE 1024 diff --git a/old_protocol.c b/old_protocol.c index d0ba48b..abbc4a8 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -637,6 +637,14 @@ static void full_rx_buffer() { } } + if(diversity_enabled) { + double *pin[2]; + pin[0]=iqinputbuffer[0]; + pin[1]=iqinputbuffer[1]; + + xdivEXT(0,BUFFER_SIZE,pin,iqinputbuffer[0]); + } + fexchange0(CHANNEL_RX0, iqinputbuffer[0], audiooutputbuffer, &error); #ifdef PSK diff --git a/radio.c b/radio.c index 9998c8d..d66112d 100644 --- a/radio.c +++ b/radio.c @@ -129,6 +129,8 @@ int drive_level=0; int tune_drive_level=0; int receivers=RECEIVERS; +int active_receiver=0; + int adc[2]={0,1}; int locked=0; @@ -226,6 +228,10 @@ double vox_gain=1; double vox_hang=250.0; int vox=0; +int diversity_enabled=0; +double i_rotate[2]={1.0,1.0}; +double q_rotate[2]={0.0,0.0}; + void init_radio() { int rc; rc=sem_init(&property_sem, 0, 0); diff --git a/radio.h b/radio.h index c0f1c1c..6961fa9 100644 --- a/radio.h +++ b/radio.h @@ -142,6 +142,8 @@ extern int tune_drive_level; extern int drive_level; int receivers; +int active_receiver; + int adc[2]; int locked; @@ -236,6 +238,10 @@ extern double vox_gain; extern double vox_hang; extern int vox; +extern int diversity_enabled; +extern double i_rotate[2]; +extern double q_rotate[2]; + extern void init_radio(); extern void setSampleRate(int rate); extern int getSampleRate(); diff --git a/vfo.c b/vfo.c index 6a01089..80ab046 100644 --- a/vfo.c +++ b/vfo.c @@ -359,8 +359,10 @@ vfo_press_event_cb (GtkWidget *widget, gpointer data) { - if((int)event->x < (my_width/2)) { + if((int)event->x < (my_width/4)) { lock_cb(NULL,NULL); + } else if((int)event->x < (my_width/2) && (int)event->x > (my_width/4)) { + start_freqent(); } else { start_step(); /* diff --git a/vox_menu.c b/vox_menu.c index 75e0966..94b34fd 100644 --- a/vox_menu.c +++ b/vox_menu.c @@ -131,12 +131,13 @@ void vox_menu(GtkWidget *parent) { gtk_grid_attach(GTK_GRID(grid),level,1,1,1,1); /* + // try to set progress bar to red GtkStyleContext *style_context; GtkCssProvider *provider = gtk_css_provider_new (); gchar tmp[64]; style_context = gtk_widget_get_style_context(level); gtk_style_context_add_provider(style_context, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); - g_snprintf(tmp, sizeof tmp, "GtkProgressBar.progress { background-color: %s; }", "red"); + g_snprintf(tmp, sizeof tmp, "progressbar.trough.progress { background-color: %s; }", "red"); gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(provider), tmp, -1, NULL); g_object_unref (provider); */ diff --git a/wdsp_init.c b/wdsp_init.c index 6760a44..1b356d5 100644 --- a/wdsp_init.c +++ b/wdsp_init.c @@ -251,6 +251,10 @@ static void setupRX(int rx) { SetRXAEQRun(rx, 0); } + // setup for diversity + create_divEXT(0,0,2,BUFFER_SIZE); + SetEXTDIVRotate(0, 2, &i_rotate, &q_rotate); + SetEXTDIVRun(0,diversity_enabled); } static void setupTX(int tx) {